Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Class which determines the agent properties for each new PedVO agent. More...
#include <PedVOInitializer.h>
Public Member Functions | |
AgentInitializer () | |
Constructor. More... | |
AgentInitializer (const AgentInitializer &init) | |
Copy Constructor. More... | |
virtual | ~AgentInitializer () |
Destructor. | |
virtual bool | setProperties (Menge::Agents::BaseAgent *agent) |
Sets the properties of the given agent based on the initializer's values. More... | |
virtual void | setDefaults () |
Sets all generators to default values. More... | |
virtual Menge::Agents::AgentInitializer * | copy () const |
Creates a copy of this AgentInitializer instance. More... | |
Public Member Functions inherited from Menge::Agents::AgentInitializer | |
AgentInitializer () | |
Constructor. More... | |
AgentInitializer (const AgentInitializer &init) | |
Copy Constructor. More... | |
bool | parseProperties (TiXmlElement *node, const std::string &sceneFldr) |
Parses an AgentSet property tag, setting agent values as appropriate. More... | |
Protected Member Functions | |
virtual bool | isRelevant (const ::std::string &tagName) |
Reports if this AgentInitializer cares about the given AgentSet property XML tag. More... | |
virtual Menge::Agents::AgentInitializer::ParseResult | setFromXMLAttribute (const ::std::string ¶mName, const ::std::string &value) |
Defines a constant value for an agent property as specified by the attribute of an agent property tag. More... | |
virtual Menge::Agents::AgentInitializer::ParseResult | processProperty (::std::string propName, TiXmlElement *node) |
Process the given <Property .../> tag. More... | |
Protected Member Functions inherited from Menge::Agents::AgentInitializer | |
bool | parsePropertySpec (TiXmlElement *node) |
Parses the Property tag that is the child of an AgentSet Parameter tag. More... | |
ParseResult | constFloatGenerator (FloatGenerator *&gen, const ::std::string &valueStr, float scale=1.f) |
Helper function for setting a property from an xml attribute. More... | |
ParseResult | constFloat (float &numValue, const ::std::string &valueStr, float scale=1.f) |
Helper function for setting a property from an xml attribute. More... | |
ParseResult | constIntGenerator (IntGenerator *&gen, const ::std::string &valueStr) |
Helper function for setting a property from an xml attribute. More... | |
ParseResult | constSizet (size_t &numValue, const ::std::string &valueStr) |
Helper function for setting a property from an xml attribute. More... | |
ParseResult | getFloatGenerator (FloatGenerator *&gen, TiXmlElement *node, float scale=1.f) |
Helper function for setting a property from an xml Property node. More... | |
ParseResult | getIntGenerator (IntGenerator *&gen, TiXmlElement *node) |
Helper function for setting a property from an xml Property node. More... | |
Protected Attributes | |
bool | _denseAware |
Controls if the agent respondes to density (true) or not (false). | |
FloatGenerator * | _strideFactor |
The stride factor of the agent. | |
FloatGenerator * | _strideBuffer |
The stride factor of the agent. | |
FloatGenerator * | _timeHorizon |
The time horizon for predicting agent collisions. | |
FloatGenerator * | _timeHorizonObst |
The time horizon for predicting obstacle collisions. | |
FloatGenerator * | _turningBias |
The turning bias. | |
Protected Attributes inherited from Menge::Agents::AgentInitializer | |
FloatGenerator * | _maxSpeed |
The maximum speed the agent can take. | |
FloatGenerator * | _maxAccel |
The maximum acceleration the agent can experience (interpreted isotropically). | |
FloatGenerator * | _prefSpeed |
The preferred speed of the agent. | |
IntGenerator * | _maxNeighbors |
The number of nearby agents used to plan dynamic respones. | |
FloatGenerator * | _neighborDist |
The maximum distance at which another agent will be considered for a response. | |
FloatGenerator * | _radius |
The agent's radius. See Agents::BaseAgent::_radius for details. | |
FloatGenerator * | _maxAngVel |
The agent's maximum angular velocity (in radians/sec) – used for controlling the changes in agent orientation. | |
size_t | _obstacleSet |
A mask indicating which obstacles affect the agent. See Agents::BaseAgent::_obstacleSet for details. | |
float | _priority |
The priority of each agent. See Agents::BaseAgent::_priority for details. | |
size_t | _class |
The population class for this agent. See Agents::BaseAgent::_class for details. | |
std::vector< BFSM::VelModifier * > | _velModifiers |
Velocity Modifiers to be applied to this class. | |
Additional Inherited Members | |
Public Types inherited from Menge::Agents::AgentInitializer | |
enum | ParseResult { FAILURE = 0, IGNORED, ACCEPTED } |
Return type for parsing efforts. Helps the various derived classes coordinate their work. More... | |
Static Public Attributes inherited from Menge::Agents::AgentInitializer | |
static bool | VERBOSE = false |
Determines if the agent properties parsing process will be verbose. | |
Class which determines the agent properties for each new PedVO agent.
PedVO::AgentInitializer::AgentInitializer | ( | ) |
Constructor.
The values for each agent take a hard-coded default values.
PedVO::AgentInitializer::AgentInitializer | ( | const AgentInitializer & | init | ) |
Copy Constructor.
init | The AgentInitializer to copy all values from. |
|
inlinevirtual |
Creates a copy of this AgentInitializer instance.
Reimplemented from Menge::Agents::AgentInitializer.
|
protectedvirtual |
Reports if this AgentInitializer cares about the given AgentSet property XML tag.
This is the mechanism by which new sub-classes can extend the parameter space. Each pedestrian model which introduces new per-agent properties that must override this function. However, the overriden function must, in turn, call the parent class if it doesn't consider the tag relevant, giving the parent class a chance to determine if the tag is relevant. This is the mechanism by which derived classes will also benefit from the <PedVO>
parameter set.
tagName | The tag to test for relevancy. |
Reimplemented from Menge::Agents::AgentInitializer.
|
protectedvirtual |
Process the given <Property .../> tag.
As a pre-condition to this function, the XML node contains a <Property.../> tag and has been confirmed to have, at least, a name attribute. Nothing else about the tag has been validated.
If the property name is unexpected, it will be ignored. If it is expected, this function will attempt to interpret the XML tag as a number distribution for a valid agent attribute. If it can do so, it is successful, if it can't, it fails.
propName | The extractd "name" property from the Property tag. |
node | The XML node for the Property tag. |
Reimplemented from Menge::Agents::AgentInitializer.
|
virtual |
Sets all generators to default values.
Resets all number generators to default const values. This assumes that all required number generators already exist and will delete them appropriately. Do not call this in the constructor.
Reimplemented from Menge::Agents::AgentInitializer.
|
protectedvirtual |
Defines a constant value for an agent property as specified by the attribute of an agent property tag.
Derived classes should override this function, but possibly call the parent class's implementation. First, it should test to see if the paramName is expected by the derived class. If so, the derived class can determine fail or accept. If it is not expected, it should call the parent class's implementation and returns its value.
paramName | A string containing the parameter name. |
value | A string containing the value for the parameter. |
Reimplemented from Menge::Agents::AgentInitializer.
|
virtual |
Sets the properties of the given agent based on the initializer's values.
This needs to be overridden by sub-classes. The first thing the sub-class should do is dynamic_cast the argument to its expected type to make sure it is the proper agent type. If not, this should be considered failure. Then it should set its unique properties an+d then call the super class's setProperties function.
agent | The agent whose properties are to be set. |
Reimplemented from Menge::Agents::AgentInitializer.