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::AgentGenerator Class Referenceabstract

The base class inital agent generation. More...

#include <AgentGenerator.h>

Inheritance diagram for Menge::Agents::AgentGenerator:
Menge::Element Menge::Agents::ExplicitGenerator Menge::Agents::HexLatticeGenerator Menge::Agents::RectGridGenerator

Public Member Functions

 AgentGenerator ()
 Constructor.
 
virtual size_t agentCount ()=0
 Reports the number of agents created. More...
 
virtual Vector2 agentPos (size_t i)=0
 Get the position of the ith agent. More...
 
void setNoiseGenerator (Math::FloatGenerator *gen)
 Sets the Generators noise generation. More...
 
Vector2 addNoise (const Vector2 &pos)
 Perturbs the given point according to the given noise generator. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual BFSM::TaskgetTask ()
 Return an optional task associated with this element. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Member Functions

virtual ~AgentGenerator ()
 Virtual destructor.
 

Protected Attributes

Math::FloatGenerator_disp
 The generator for displacement amount (defaults to zero).
 
Math::FloatGenerator_dir
 The generator for angular displacement.
 

Detailed Description

The base class inital agent generation.

This is an abstract class, primarily defining the agent generation abstraction. Essentially, the AgentGenerator produces a set of agent positions. Its properties should be sufficient to produce a count of agents with defined positions.

Member Function Documentation

Vector2 Menge::Agents::AgentGenerator::addNoise ( const Vector2 pos)

Perturbs the given point according to the given noise generator.

Parameters
posThe position to perturb.
Returns
The perturbed point.
virtual size_t Menge::Agents::AgentGenerator::agentCount ( )
pure virtual

Reports the number of agents created.

Returns
The number of agents this generator creates.

Implemented in Menge::Agents::HexLatticeGenerator, Menge::Agents::ExplicitGenerator, and Menge::Agents::RectGridGenerator.

virtual Vector2 Menge::Agents::AgentGenerator::agentPos ( size_t  i)
pure virtual

Get the position of the ith agent.

Parameters
iThe index of the requested agent.
Returns
The 2D position of the agent based on the generator's parameters.
Exceptions
AgentGeneratorExceptionif the index, i, is invalid.

Implemented in Menge::Agents::HexLatticeGenerator, Menge::Agents::ExplicitGenerator, and Menge::Agents::RectGridGenerator.

void Menge::Agents::AgentGenerator::setNoiseGenerator ( Math::FloatGenerator gen)

Sets the Generators noise generation.

The AgentGenerator takse position of the float generator provided and will delete it up on its destruction.

Parameters
genThe generator.

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