Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The base class for extracting simulator settings from the XML specification. More...
#include <XMLSimulatorBase.h>
Public Member Functions | |
XMLSimulatorBase () | |
Constructor. | |
~XMLSimulatorBase () | |
Destructor. | |
virtual bool | hasExpTarget () |
Reports if there are any target-specific experiment parameters. More... | |
virtual bool | isExpTarget (const std::string &tagName)=0 |
Given the name of a tag which is the child of <Experiment>, reports if it contains target-specific experiment parameters. More... | |
virtual bool | setExpParam (const std::string ¶mName, const std::string &value)=0 throw ( XMLParamException ) |
Given the name of the xml param and its string value, sets the parameter in the simulator. More... | |
virtual BaseAgent * | addAgent (const Vector2 &pos, AgentInitializer *agentInit)=0 |
Add an agent with specified position to the simulator whose properties are defined by the given agent initializer. More... | |
virtual void | setElevationInstance (Elevation *elevation)=0 |
Set the elevation instance of the simulator. More... | |
virtual bool | hasElevation () const =0 |
Reports if the elevation has been set. More... | |
virtual void | setSpatialQuery (SpatialQuery *spatialQuery)=0 |
Sets the spatial query instance of the simulator. More... | |
virtual SpatialQuery * | getSpatialQuery ()=0 |
Gets the spatial query instance of the simulator. More... | |
virtual bool | hasSpatialQuery () const =0 |
Reports if the spatial query has been set. More... | |
virtual bool | initSpatialQuery ()=0 |
Initalize spatial query structure. | |
virtual void | finalize () |
After all agents and all obstacles have been added to the scene does the work to finish preparing the simulation to be run. | |
SimulatorState * | getInitialState () |
Returns a pointer to the simulator's initial state. More... | |
Protected Attributes | |
SimulatorState * | _initState |
The initial state of the simulator. | |
The base class for extracting simulator settings from the XML specification.
In order to use the SimXMLLoader class to read XML files and set parameters The simulator must extend this abstract class and implement the given virtual functions.
A "target"-specific parameter refers to the simulator type. In other words, If a simulator expects particular parameters, there should be a tag with the target name and a list of parameter values. The functionality of this class defines that functionality.
|
pure virtual |
Add an agent with specified position to the simulator whose properties are defined by the given agent initializer.
It uses the agent initializer to define the values of the remaining agent parameters
pos | The 2d vector representing the agent's position |
agentInit | The AgentInitializer necessary to parse AgentSet properties |
Implemented in Menge::Agents::SimulatorBase< Agent >.
|
inline |
Returns a pointer to the simulator's initial state.
|
pure virtual |
Gets the spatial query instance of the simulator.
Implemented in Menge::Agents::SimulatorInterface.
|
pure virtual |
Reports if the elevation has been set.
Implemented in Menge::Agents::SimulatorInterface.
|
inlinevirtual |
Reports if there are any target-specific experiment parameters.
The default case is to assume that the simulator does have particular parameters.
Reimplemented in Menge::Agents::SimulatorBase< Agent >.
|
pure virtual |
Reports if the spatial query has been set.
Implemented in Menge::Agents::SimulatorInterface.
|
pure virtual |
Given the name of a tag which is the child of <Experiment>, reports if it contains target-specific experiment parameters.
It is guaranteed that the labels "AgentSet" and "Obstacle" will never be given as input.
tagName | The name of the candidate experiment XML tag. |
Implemented in Menge::Agents::SimulatorBase< Agent >.
|
pure virtual |
Set the elevation instance of the simulator.
elevation | The elevation object. |
Implemented in Menge::Agents::SimulatorInterface.
|
pure virtual |
Given the name of the xml param and its string value, sets the parameter in the simulator.
Common parameters and target-specific parameters will be passed into this function. It is the responsibility of the programmer to make sure the default case of any parameter should fall through to the SimulatorBase::setExpParam function.
paramName | The name of the XML parameter. |
value | The string representation of the parameter value. It is the responsibility of the particular sub-class to translate the representation as necessary. |
An | XMLParamException if there was a problem with the parameter name/value |
Implemented in Menge::Agents::SimulatorBase< Agent >.
|
pure virtual |
Sets the spatial query instance of the simulator.
spatialQuery | The spatial query object. |
Implemented in Menge::Agents::SimulatorInterface.