83 void init(
float xRange,
float yRange);
121 void addObstacle(
const std::pair<Vector2D, Vector2D>& lineSegment);
LQProximityDatabase2D SpatialProximityDatabase
The spatial proximity database.
Definition: Proximity2D.h:153
void addAgent(AgentInitialParameters ¶meters)
Add a new agent to the simulation given its default parameters.
Definition: SimulationEngine.cpp:127
A line segment obstacle class.
Definition: LineObstacle.h:25
void setMaxSteps(int steps)
Sets the maximum number of simulation steps.
Definition: SimulationEngine.h:165
void exportSimulation(std::ofstream &file)
Outputs a simulation step in a file.
Definition: SimulationEngine.cpp:115
vector< Agent * > _agents
The agents in the simulation.
Definition: SimulationEngine.h:61
int getMaxSteps() const
Returns the number of simulations steps.
Definition: SimulationEngine.h:159
void setTimeStep(float dt)
Sets the time step of the simulation.
Definition: SimulationEngine.h:155
LineObstacle * getObstacle(int id)
Returns the corresponding line obstacle given its id.
Definition: SimulationEngine.h:146
Simulates the anticipatory behavior of an agent.
Definition: Agent.h:31
bool _reachedGoals
Determine whether all agents have reached their goals.
Definition: SimulationEngine.h:55
The initial parameters for a single agent.
Definition: AgentInitialParameters.h:25
const vector< LineObstacle * > & getObstacles()
Returns the list of obstacles.
Definition: SimulationEngine.h:134
void updateSimulation()
Performs a simulation/integration step i.e. updates the acceleration, velocity and position of the si...
Definition: SimulationEngine.cpp:68
float getGlobalTime() const
Returns the global time of the simulation. Initially this time is set to zero.
Definition: SimulationEngine.h:168
int getNumAgents() const
Returns the number of agents in the simulation.
Definition: SimulationEngine.h:171
bool endSimulation()
This function determines whether the simulation has to stop i.e. when all characters have reached the...
Definition: SimulationEngine.cpp:97
SpatialProximityDatabase * _spatialDatabase
The proximity database.
Definition: SimulationEngine.h:58
The main class of the library.
Definition: SimulationEngine.h:37
float _globalTime
The current time in the simulation.
Definition: SimulationEngine.h:46
Contains the Agent class.
int _maxSteps
The maximum number of simulation steps.
Definition: SimulationEngine.h:52
float getTimeStep() const
Returns the time step of the simulation.
Definition: SimulationEngine.h:149
Contains the LineObstacle class.
const vector< Agent * > & getAgents()
Returns the list of agents in the simulation.
Definition: SimulationEngine.h:131
void init(float xRange, float yRange)
Initialization of the simulation engine. All characters in the library have the same time step...
Definition: SimulationEngine.cpp:56
int _iteration
The current iteration step.
Definition: SimulationEngine.h:49
void addObstacle(const std::pair< Vector2D, Vector2D > &lineSegment)
Add a new line obstacle to the simulation.
Definition: SimulationEngine.cpp:136
Agent * getAgent(int id)
Returns the corresponding agent given its id.
Definition: SimulationEngine.h:140
SpatialProximityDatabase * getSpatialDatabase()
Returns a pointer to the proximity database of the engine.
Definition: SimulationEngine.h:128
vector< LineObstacle * > _obstacles
The obstacles in the simulation.
Definition: SimulationEngine.h:64
void updateVisualisation()
Outputs a simulation step in the console.
Definition: SimulationEngine.cpp:102
float _dt
The time step in the simulation.
Definition: SimulationEngine.h:43
SimulationEngine()
Definition: SimulationEngine.cpp:24
~SimulationEngine()
Definition: SimulationEngine.cpp:31
int getIterationNumber() const
Returns the current simulation step.
Definition: SimulationEngine.h:174