Similar as in the TryOut I uploaded, we will need a Class for the Agents
it should get passed the parameters:
number of agents (Int)
radius = (float or Int?) here we haven't been done discussing but this variable can by now just be defined but stay without a value? It can become the distance how far the agent is looking to decide his next move or it is the radius for each sensor.
angle for sensores (degree as float) = angle alpha in the attached picture, this ange is the same for all agents. it defines the angle in which the agent can look for his next move
angle of movement (degree as float) = angle beta in the attached picture, this is an independent value for each agent. it defines the angle in which the agent has moved in the last move and defines the direction in which the agent is currently looking
Position (float) = contains an x and y coordinate.
Methods:
the init method should be creating a given number of agents with a given radius and sensor angle for all agents.
eacht Agent should have a dictionary with current position and angle of movement
another method should update each agents position and angle of movement after eacht step
there has to be a third method "mapping" that calculates the position of float coordinates to a position in the array (we did not discussed yet in what class this method belong, but I would recomend it here)
Similar as in the TryOut I uploaded, we will need a Class for the Agents
it should get passed the parameters:
number of agents (Int)
radius = (float or Int?) here we haven't been done discussing but this variable can by now just be defined but stay without a value? It can become the distance how far the agent is looking to decide his next move or it is the radius for each sensor.
angle for sensores (degree as float) = angle alpha in the attached picture, this ange is the same for all agents. it defines the angle in which the agent can look for his next move
angle of movement (degree as float) = angle beta in the attached picture, this is an independent value for each agent. it defines the angle in which the agent has moved in the last move and defines the direction in which the agent is currently looking
Position (float) = contains an x and y coordinate.
Methods: the init method should be creating a given number of agents with a given radius and sensor angle for all agents. eacht Agent should have a dictionary with current position and angle of movement
another method should update each agents position and angle of movement after eacht step
there has to be a third method "mapping" that calculates the position of float coordinates to a position in the array (we did not discussed yet in what class this method belong, but I would recomend it here)