Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The core namespace. All elements of Menge are contained in this namespace. More...
Classes | |
class | AgentEventEffect |
The event effect class that operates on sets of agents. More... | |
class | AgentEventTarget |
The base class for all event targets which target agents. More... | |
class | AgentEventTargetFactory |
Factory for the AgentEventTarget. More... | |
class | AgentPropertyEffect |
The base class event effect changes agent properties. More... | |
class | AgentPropertyEffectFactory |
The factory for agent property event effects. More... | |
class | AgentPropertyManipulator |
Base class for manipulating agent properties in an undoable manner. The undo is limited, it only maintains knowledge of one manipulation. If multiple manipulations are applied, only the last can be undone. More... | |
class | AStarMinHeap |
An implementation of a min heap for A* algorithm. The heap needs to be able to restructure itself because the values of nodes IN the heap can change due to the A* algorithm. More... | |
class | Attribute |
An element attribute. More... | |
class | AttributeDefinitionException |
Exception class for attribute definition problems (i.e., using the wrong type of attribute for the wrong data-type). More... | |
class | AttributeDefinitionFatalException |
The fatal attribute definition exception. More... | |
class | AttributeSet |
A set of attributes. More... | |
class | BaseAgentContext |
Context class for displaying various characteristics of the Agents::BaseAgent class. More... | |
class | BoolAttribute |
The class which specifies an xml attribute with a boolean-type value. More... | |
class | Element |
The basic interface of extendible Menge Elements. More... | |
class | ElementDB |
The base functionality of an element database. More... | |
class | ElementFactory |
The templated base class for a plugin element. More... | |
class | Event |
The definition of a Menge event. More... | |
class | EventEffect |
The definition of a response to an event. More... | |
class | EventEffectFactory |
The base class for generating event effects. More... | |
class | EventException |
The base event exception. More... | |
class | EventFatalException |
The fatal event exception. More... | |
class | EventResponse |
A response to an event trigger. It combines an effect with a target. More... | |
class | EventSystem |
The main event engine – causes event triggers to be evaluated and effects to be applied. More... | |
class | EventTarget |
The base class for all event targets. More... | |
class | EventTargetFactory |
The base class for generating event targets. More... | |
class | EventTrigger |
The base class for event triggers. More... | |
class | EventTriggerFactory |
The base class for generating event triggers. More... | |
class | FloatAttribute |
The class which specifies an xml attribute with a float-type value. More... | |
class | FloatDistributionAttribute |
The class which specifies an xml attribute with a float distribution value. More... | |
class | FunnelApex |
The apex of the funnel. More... | |
class | FunnelEdge |
The edge of a funnel. More... | |
class | FunnelPlanner |
The class that implements the funnel algorithm. More... | |
class | GLContextManager |
Handles updating the scene graph when there is a new OpenGL context. More... | |
class | Graph |
A roadmap graph and the infrastructure for performing graph searches. NOTE: This implementation assumes that the graph doesn't change. More... | |
class | GraphEdge |
A graph edge. More... | |
class | GraphVertex |
A graph vertex. More... | |
class | Image |
Wrapper for the managed ImageData. More... | |
class | ImageData |
Manged image data (see ManagedData). More... | |
class | IntAttribute |
The class which specifies an xml attribute with a int-type value. More... | |
class | IntDistributionAttribute |
The class which specifies an xml attribute with an int distribution value. More... | |
class | Logger |
An html logger - writes messages to a formatted html file. More... | |
class | ManagedData |
The interface for managed data (essentially smart poitners). More... | |
class | ManagedDataWrapper |
A wrapper for managed data - automatically handles referencing and deletion of managed data. More... | |
class | MengeException |
Base exception class for menge operations. More... | |
class | MengeFatalException |
Base class for fatal exceptions. More... | |
class | NamedStateMemberTarget |
Defines the target of an event effect based on membership relationship to a single named state. More... | |
class | NamedStateMemberTargetFactory |
The factory to generate NamedStateMemberTarget instances. More... | |
class | NavMesh |
The class for defining a navigation mesh. A decomposition of the free space into a connected mesh of convex (or near convex) polygons used for global planning in planar or non-planar environments. More... | |
class | NavMeshEdge |
The navigation mesh adjacency graph edge. More... | |
class | NavMeshLocalizer |
Class responsible for tracking agent relatinoships to the navigation mesh: its current location and its path. More... | |
class | NavMeshLocation |
Class for indicating how the location of the agent is defined. Either by a portal path or a node. More... | |
class | NavMeshNode |
The navigation mesh adjacency graph node. It corresponds to a convex polygon in the navigation mesh. More... | |
class | NavMeshObstacle |
Specification of an obstacle. It is the same as a pedModel specification but includes a pointer to a node to which it is attached. More... | |
class | NavMeshPoly |
The polygon used in each node of a navigation mesh graph. More... | |
class | NMNodeGroup |
A navigation mesh node group. More... | |
class | OffsetAgentPropertyEffectFactory |
Factory for the OffsetPropertyEffect. More... | |
class | OffsetPropertyManipulator |
Modifies a particular agent property based by adding the value from a distribution to the original agent parameter value. More... | |
class | PathPlanner |
Class for computing paths through a navigation mesh. More... | |
class | PathPlannerException |
Exception class for path planner. More... | |
class | PathPlannerFatalException |
The fatal path planner exception. More... | |
class | Plugin |
The base plug-in class. More... | |
class | PluginEngine |
The class responsible for finding, managing, and deleting plugins. More... | |
class | Portal |
A simple portal definition. More... | |
class | PortalPath |
The definition of a path through space comprising of a sequence of portals. More... | |
class | PortalRoute |
The definition of a route through a navigation mesh from a start to an end node. More... | |
class | ReadersWriterLock |
The definition of a readers-writer lock. More... | |
class | Resource |
Basic class for managing on-disk resources. More... | |
class | ResourceException |
A base exception for resources to throw. More... | |
class | ResourceFatalException |
The fatal resource exception. More... | |
class | ResourceManager |
Class to handle management of on-disk resources. More... | |
class | ResourcePtr |
Base Class providing a pointer interface to Resources. More... | |
class | RoadMapPath |
A path on a roadmap between vertices. More... | |
class | ScaleAgentPropertyEffectFactory |
Factory for the ScalePropertyEffect. More... | |
class | ScalePropertyManipulator |
Modifies a particular agent property based by multiplying the value from a distribution to the original agent parameter value. More... | |
class | SetAgentPropertyEffectFactory |
Factory for the SetPropertyEffect. More... | |
class | SetPropertyManipulator |
Modifies a particular agent property based by explicitly setting the property value from a distribution. More... | |
class | SimDBException |
Exception for SimulatorDB issues. More... | |
class | SimDBFatalException |
The fatal SimulatorDB exception. More... | |
class | SimpleLock |
The definition of a simple mutex-style lock. More... | |
class | SimSystem |
Templated class for performing simulation. More... | |
class | SimSystemException |
Generic exception for the SimSystem. More... | |
class | SimSystemFatalException |
The fatal SimSystem exception. More... | |
class | SimulatorDB |
The simulator database class. More... | |
class | SimulatorDBEntry |
An entry in the simulator database. More... | |
class | SizeTAttribute |
The class which specifies an xml attribute with a size_t-type value. More... | |
class | StateEvtTrigger |
The base class event triggers which depend on state properties. More... | |
class | StateEvtTriggerFactory |
The factory for state event triggers. More... | |
class | StatePopIncreaseTrigger |
A trigger that fires off when a state's population increases. More... | |
class | StatePopIncTriggerFactory |
The factory for StatePopIncreaseTrigger event triggers. More... | |
class | StringAttribute |
The class which specifies an xml attribute with a string-type value. More... | |
class | UtilException |
Exception thrown when a utility function fails.. More... | |
class | UtilFatalException |
Exception thrown when the utility functions have an error which cannot be recovered from. More... | |
class | Vec2DDistributionAttribute |
The class which specifies an xml attribute with a 2D float distribution value. More... | |
class | VectorField |
A simple 2D vector field. More... | |
class | VisAgent |
The basic agent visualization class: a selectable cylinder. More... | |
class | VisObstacle |
A simple class for drawing a simulation obstacle (line segment). The obstacle is drawn with lines in 3D space. More... | |
class | WayPortal |
The basic structure defining a way "point" along a path through a navigation mesh. It consists of the navigation mesh edge to pass through and the node one should be in while heading to the edge. More... | |
Typedefs | |
typedef ElementDB < EventEffectFactory, EventEffect > | EventEffectDB |
The database of registered event effects implementations. | |
typedef ElementDB < EventTargetFactory, EventTarget > | EventTargetDB |
The database of registered event targets implementations. | |
typedef ElementDB < EventTriggerFactory, EventTrigger > | EventTriggerDB |
The database of registered event triggers implementations. | |
typedef HASH_MAP< size_t, BFSM::StateContext * > | StateContextMap |
A map from state ids to statecontexts to facilitate lookups for a visualized agent. | |
typedef ResourcePtr < NavMeshLocalizer > | NavMeshLocalizerPtr |
forward declaration. See NavMeshLocalizer for more details More... | |
typedef ResourcePtr< Graph > | GraphPtr |
forward declaration of graph resource pointer. see graph.h for more details More... | |
typedef ResourcePtr< VectorField > | VectorFieldPtr |
forward declaration of VectorField resource pointer. see VectorField.h for more details More... | |
typedef std::map< std::string, Plugin * > | PluginMap |
Mapping from the file name of the dynamic library to a pointer to the loaded plugin. | |
typedef ResourcePtr< NavMesh > | NavMeshPtr |
The definition of the managed pointer for NavMesh data. | |
typedef std::set< size_t > | OccupantSet |
A collection of agent ids. It represents the population of each nav mesh node. | |
typedef OccupantSet::iterator | OccupantSetItr |
Iterator for an OccupantSet. | |
typedef OccupantSet::const_iterator | OccupantSetCItr |
Const iterator for an OccupantSet. | |
typedef size_t | RouteKey |
Definition of the identifier of a Route. | |
typedef std::list< PortalRoute * > | PRouteList |
A list of PortalRoute pointers. | |
typedef PRouteList::iterator | PRouteListItr |
An iterator to a PRouteList. | |
typedef PRouteList::const_iterator | PRouteListCItr |
A const iterator to a PRouteList. | |
typedef HASH_MAP< RouteKey, PRouteList > | PRouteMap |
A mapping from RouteKey to PRouteList. | |
typedef PRouteMap::iterator | PRouteMapItr |
An iterator to a PRouteMap. | |
typedef PRouteMap::const_iterator | PRouteMapCItr |
A const iterator to a PRouteMap. | |
typedef std::map< std::string, Resource * > | ResourceMap |
Type declaration for a resource map - mapping file names to resource pointers. | |
typedef std::list < SimulatorDBEntry * > | EntryList |
A list of database entries. | |
Functions | |
BFSM::PropertyOperand | parsePropertyName (const std::string &opName) |
Helper function for parsing property actions. More... | |
Event * | parseEvent (TiXmlElement *node, const std::string &specFldr) |
Parses the xml specification of an event and returns a parsed event. More... | |
Logger & | operator<< (Logger &out, const BFSM::PropertyOperand op) |
Friend function for printing string versions of the PropertyOperand enum. More... | |
GraphPtr | loadGraph (const std::string &fileName) throw ( ResourceException ) |
Loads the graph of the given name. More... | |
NavMeshPtr | loadNavMesh (const std::string &fileName) throw ( ResourceException ) |
Loads the navigation mesh of the given name. More... | |
NavMeshLocalizerPtr | loadNavMeshLocalizer (const std::string &fileName, bool usePlanner) throw ( ResourceException ) |
Loads the navigation mesh of the given name. More... | |
RouteKey | makeRouteKey (unsigned int start, unsigned int end) |
Creates unique keys for a route based on start and end nodes. More... | |
Logger & | operator<< (Logger &out, const VectorField &vf) |
VectorFieldPtr | loadVectorField (const std::string &fileName) throw ( ResourceException ) |
Loads the vector field of the given name. More... | |
void | findAndReplace (std::string &source, const std::string &find, const std::string &replace) |
Simple helper function for doing text search and replace. More... | |
Logger & | operator<< (Logger &logger, const std::string &msg) |
Logger & | operator<< (Logger &logger, const char *msg) |
Logger & | operator<< (Logger &logger, long unsigned int value) |
Logger & | operator<< (Logger &logger, unsigned int value) |
Logger & | operator<< (Logger &logger, int value) |
Logger & | operator<< (Logger &logger, float value) |
Logger & | operator<< (Logger &logger, double value) |
Logger & | operator<< (Logger &logger, Logger::LogType type) |
float | toFloat (const std::string &value) throw ( UtilException ) |
Converts a string to a float. More... | |
int | toInt (const std::string &value) throw ( UtilException ) |
Converts a string to an int. More... | |
size_t | toSize_t (const std::string &value) throw ( UtilException ) |
Converts a string to a size_t. More... | |
ImageData * | readImageData (const std::string &fileName) |
Image * | loadImage (const std::string &fileName) |
Given a filename, returns a pointer to an Image with that data. More... | |
template<typename TData > | |
TData * | getResource (const std::string &name, std::map< std::string, TData * > &map) |
Templated function for acquiring a managed data resource from its name. More... | |
template<typename T , typename TData > | |
T * | loadManagedData (const std::string &fileName, TData *(*reader)(const std::string &)) |
Templated function for loading a managed data resource. More... | |
template<typename TData > | |
void | removeResource (TData *data, std::map< std::string, TData * > &map) |
Tempalted function for removing a resource from the managed databse. More... | |
size_t | addTimer (const std::string &displayString) |
Creates a lap timer which uses the given label for display. More... | |
void | startTimer (size_t index) |
Starts the timer with the given identifier. More... | |
void | stopTimer (size_t index) |
Stops the timer with the given identifier. More... | |
void | lapTimer (size_t index) |
Lap the ith timer. More... | |
float | averageTime (size_t index) |
Reports the average time of the ith timer. More... | |
void | printAverages () |
Prints the average times for all timers, displayed with the accompanying messages and set units. | |
void | setUnits (float scale, const std::string &unitString) |
Sets the internal units of the profiler. More... | |
bool | snapshotPNG (int windowWidth, int windowHeight, const char *filename) |
Function to create a png from the current screenbuffer. More... | |
Logger & | operator<< (Logger &out, const Vis::ViewConfig &cfg) |
Streaming output operator to display configuration specification. More... | |
Variables | |
BFSM::FSM * | ACTIVE_FSM = 0x0 |
The fsm running for the simulation. | |
float | SIM_TIME = 0.f |
The global simulation time. | |
float | SIM_TIME_STEP = 0.f |
The simulation time step. | |
Agents::SpatialQuery * | SPATIAL_QUERY = 0x0 |
The spatial query structure for the simulation. | |
Agents::Elevation * | ELEVATION = 0x0 |
The elevation structure for the simulation. | |
Agents::SimulatorInterface * | SIMULATOR = 0x0 |
The simulator for use with some plugins that need it. | |
Menge::EventSystem * | EVENT_SYSTEM = new Menge::EventSystem() |
The event system. | |
MENGE_API const float | INFTY = 1e6f |
A convenient definition of infinity. | |
MENGE_API const float | PI = (float)(asin( 1.0f ) * 2.f) |
pi. | |
MENGE_API const float | TWOPI = PI * 2.f |
2 * pi. | |
MENGE_API const float | HALFPI = PI * 0.5f |
pi / 2. | |
MENGE_API const float | DEG_TO_RAD = PI / 180.0f |
Scale factor for converting degrees to radians. | |
MENGE_API const float | RAD_TO_DEG = 180.0f / PI |
Scale factor for converting radians to degrees. | |
MENGE_API const float | EPS = 0.00001f |
Suitably small number for testing for functional zero values. | |
const float | MIN_EDGE_WIDTH = 0.00001f |
The minimum width for an edge to be considered valid. | |
Logger | logger |
Globally available Logger. More... | |
The core namespace. All elements of Menge are contained in this namespace.
typedef ResourcePtr< Graph > Menge::GraphPtr |
forward declaration. See NavMeshLocalizer for more details
The definition of the managed pointer for NavMeshLocalizer data.
typedef ResourcePtr< VectorField > Menge::VectorFieldPtr |
forward declaration of VectorField resource pointer. see VectorField.h for more details
The definition of the managed pointer for VectorField data.
size_t Menge::addTimer | ( | const std::string & | displayString | ) |
Creates a lap timer which uses the given label for display.
displayString | The string to display when reporting the profiling results. |
float Menge::averageTime | ( | size_t | index | ) |
Reports the average time of the ith timer.
index | The timer identifier supplied by addTimer |
|
inline |
Simple helper function for doing text search and replace.
source | The string to change. |
find | The sub-strings to find and replace in the main string. |
replace | The sub-string to input into the main string. |
TData* Menge::getResource | ( | const std::string & | name, |
std::map< std::string, TData * > & | map | ||
) |
Templated function for acquiring a managed data resource from its name.
name | The name of the on-disk resource. |
map | The mapping from name to in-memory resource. |
void Menge::lapTimer | ( | size_t | index | ) |
Lap the ith timer.
index | The timer identifier supplied by addTimer |
GraphPtr Menge::loadGraph | ( | const std::string & | fileName | ) | |
throw | ( | ResourceException | |||
) |
Loads the graph of the given name.
fileName | The name of the file containing the graph definition. |
A | ResourceException if the data is unable to be instantiated. |
MENGE_API Image * Menge::loadImage | ( | const std::string & | fileName | ) |
T* Menge::loadManagedData | ( | const std::string & | fileName, |
TData *(*)(const std::string &) | reader | ||
) |
Templated function for loading a managed data resource.
For each type of managed data and its wrapper, a function should exist that simply calls this function, templated on the wrapper and managed data types providing the name and the managed data reader function. See Image for an example.
fileName | The name of the on-disk resource. |
reader | A pointer to the resource reading function. |
NavMeshPtr Menge::loadNavMesh | ( | const std::string & | fileName | ) | |
throw | ( | ResourceException | |||
) |
Loads the navigation mesh of the given name.
fileName | The name of the file containing the navigation mesh definition. |
A | ResourceException if the data is unable to be instantiated. |
NavMeshLocalizerPtr Menge::loadNavMeshLocalizer | ( | const std::string & | fileName, |
bool | usePlanner | ||
) | |||
throw | ( | ResourceException | |
) |
Loads the navigation mesh of the given name.
fileName | The name of the file containing the navigation mesh definition. |
usePlanner | Indicates if a planner is required (true) or not (false). |
A | ResourceException if the data is unable to be instantiated. |
VectorFieldPtr Menge::loadVectorField | ( | const std::string & | fileName | ) | |
throw | ( | ResourceException | |||
) |
Loads the vector field of the given name.
fileName | The name of the file containing the vector field definition. |
A | ResourceException if the data is unable to be instantiated. |
RouteKey Menge::makeRouteKey | ( | unsigned int | start, |
unsigned int | end | ||
) |
Creates unique keys for a route based on start and end nodes.
Mangles the start and end node identifiers into a RouteKey for using in the map. This limits the number of nodes in the navigation mesh to the size of size_t (on a 64-bit machine it is most likely 8 bytes which means it can support 4 billion nodes in the mesh.
start | ID of start node. |
end | ID of end node. |
Logger & Menge::operator<< | ( | Logger & | out, |
const BFSM::PropertyOperand | op | ||
) |
Friend function for printing string versions of the PropertyOperand enum.
out | The stream to write the string to. |
op | The ProperyOperand to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
const std::string & | msg | ||
) |
logger | A reference to a logger. |
msg | The string to write. |
Logger& Menge::operator<< | ( | Logger & | out, |
const VectorField & | vf | ||
) |
out | The output stream. |
vf | The vector field to convert to a string. |
Logger& Menge::operator<< | ( | Logger & | logger, |
const char * | msg | ||
) |
logger | A reference to a logger. |
msg | The string to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
long unsigned int | value | ||
) |
logger | A reference to a logger. |
value | The value to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
unsigned int | value | ||
) |
logger | A reference to a logger. |
value | The value to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
int | value | ||
) |
logger | A reference to a logger. |
value | The value to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
float | value | ||
) |
logger | A reference to a logger. |
value | The value to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
double | value | ||
) |
logger | A reference to a logger. |
value | The value to write. |
Logger& Menge::operator<< | ( | Logger & | logger, |
Logger::LogType | type | ||
) |
logger | A reference to a logger. |
type | The value to write. |
MENGE_API Logger & Menge::operator<< | ( | Logger & | out, |
const Vis::ViewConfig & | cfg | ||
) |
Streaming output operator to display configuration specification.
out | The output stream to which to write the view configuration. |
cfg | The configuration to convert to a string. |
Event * Menge::parseEvent | ( | TiXmlElement * | node, |
const std::string & | specFldr | ||
) |
Parses the xml specification of an event and returns a parsed event.
The event instance will still need to be finalized.
node | The tiny xml node containing the event specification. |
specFldr | The path to the specification file. All external resource references in the spec file are defined relative to this folder. |
MENGE_API BFSM::PropertyOperand Menge::parsePropertyName | ( | const std::string & | opName | ) |
Helper function for parsing property actions.
It converts the xml string indicating the property to an enumerated value
opName | The name of the operand as specified in the xml specification. |
ImageData* Menge::readImageData | ( | const std::string & | fileName | ) |
fileName | The path to a valid image file. |
void Menge::removeResource | ( | TData * | data, |
std::map< std::string, TData * > & | map | ||
) |
Tempalted function for removing a resource from the managed databse.
This should be called by the managed data instance in its destructor. The data is no longer valid and should need to be reloaded before re-use.
data | A pointer to the managed data. |
map | The map of names to manage data instances of this type. |
void Menge::setUnits | ( | float | scale, |
const std::string & | unitString | ||
) |
Sets the internal units of the profiler.
scale | The scale of the units to report the elapsed time in. e.g., 1.0 –> seconds, 0.001 –>, 1e-6 –> microseconds. |
unitString | The units which accompany the given scale – for printing purposes. |
bool Menge::snapshotPNG | ( | int | windowWidth, |
int | windowHeight, | ||
const char * | filename | ||
) |
void Menge::startTimer | ( | size_t | index | ) |
Starts the timer with the given identifier.
index | The timer identifier supplied by addTimer |
void Menge::stopTimer | ( | size_t | index | ) |
Stops the timer with the given identifier.
index | The timer identifier supplied by addTimer |
MENGE_API float Menge::toFloat | ( | const std::string & | value | ) | |
throw | ( | UtilException | |||
) |
Converts a string to a float.
value | A string representing a float value. |
A | UtilException if the string is improperly formatted. |
MENGE_API int Menge::toInt | ( | const std::string & | value | ) | |
throw | ( | UtilException | |||
) |
Converts a string to an int.
value | A string representing a int value. |
A | UtilException if the string is improperly formatted. |
MENGE_API size_t Menge::toSize_t | ( | const std::string & | value | ) | |
throw | ( | UtilException | |||
) |
Converts a string to a size_t.
value | A string representing a size_t value. |
A | UtilException if the string is improperly formatted. |