Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Menge::Agents::SimXMLLoader Class Reference

Class for parsing the SCENE XML specification and initialize a simulator It only knows the most fundamental common aspects of the file, relying on the Simulator to know of its own specific domain knowledge. More...

#include <SimXMLLoader.h>

Public Member Functions

 SimXMLLoader (XMLSimulatorBase *sim)
 Constructor. More...
 
bool loadFromXML (const std::string &xmlName, AgentInitializer *agentInit, bool verbose=false)
 Parse the xml and load the given simulator. More...
 

Protected Member Functions

bool parseAgentGroup (TiXmlElement *node, AgentInitializer *agentInit)
 Parses the definition of an AgentGroup. More...
 
bool parseObstacleSet (TiXmlElement *node)
 Parses the definition of an obstacleset. More...
 
bool parseAgentProfile (TiXmlElement *node, AgentInitializer *agentInit)
 Parses the definition of an agent profile. More...
 

Protected Attributes

std::string _sceneFldr
 The folder in which the scene configuration file appears.
 
XMLSimulatorBase_sim
 The simulator to populate based on the contents of the xml.
 
unsigned int _agtCount
 The number of agents loaded.
 
HASH_MAP< std::string,
AgentInitializer * > 
_profiles
 Mapping from agent profile name to agent initializer.
 

Detailed Description

Class for parsing the SCENE XML specification and initialize a simulator It only knows the most fundamental common aspects of the file, relying on the Simulator to know of its own specific domain knowledge.

Constructor & Destructor Documentation

Menge::Agents::SimXMLLoader::SimXMLLoader ( XMLSimulatorBase sim)

Constructor.

Parameters
simThe simulator to populate based on definition in XML.

Member Function Documentation

bool Menge::Agents::SimXMLLoader::loadFromXML ( const std::string &  xmlName,
AgentInitializer agentInit,
bool  verbose = false 
)

Parse the xml and load the given simulator.

Parameters
xmlNameThe path to the xml file simulation specification.
agentInitThe AgentInitializer necessary to parse AgentSet properties
verboseDetermines if parsing outputs progress information (true) or parses silently (false).
Returns
True if the simulation is successfully loaded, false otherwise.
bool Menge::Agents::SimXMLLoader::parseAgentGroup ( TiXmlElement *  node,
AgentInitializer agentInit 
)
protected

Parses the definition of an AgentGroup.

Parameters
nodeA pointer to the XML node containing the definition.
agentInitThe AgentInitializer necessary to parse AgentProfile properties
Returns
A boolean reporting success (true) or failure (false).
bool Menge::Agents::SimXMLLoader::parseAgentProfile ( TiXmlElement *  node,
AgentInitializer agentInit 
)
protected

Parses the definition of an agent profile.

Parameters
nodeA pointer to the XML node containing the definition.
agentInitThe AgentInitializer necessary to parse AgentProfile properties
Returns
A boolean reporting success (true) or failure (false).
bool Menge::Agents::SimXMLLoader::parseObstacleSet ( TiXmlElement *  node)
protected

Parses the definition of an obstacleset.

Parameters
nodeA pointer to the XML node containing the obstacleset.
Returns
A boolean reporting success (true) or failure (false).

The documentation for this class was generated from the following files: