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 Attributes | List of all members
Menge::Agents::RectGridGenerator Class Reference

Definition of an agent generator class which produces agents based on the positions of intersections on a lattice–one agent per intersection. More...

#include <RectGridGenerator.h>

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

Public Member Functions

 RectGridGenerator ()
 Constructor.
 
virtual size_t agentCount ()
 Reports the number of agents created. More...
 
virtual Vector2 agentPos (size_t i)
 Get the position of the ith agent. More...
 
void setAnchor (const Vector2 &p)
 Sets the anchor position. More...
 
void setOffset (const Vector2 &o)
 Sets the offset value. More...
 
void setXCount (size_t count)
 Sets the number of agents in the local x-direction. More...
 
void setYCount (size_t count)
 Sets the number of agents in the local y-direction. More...
 
void setAgentCounts (size_t xCount, size_t yCount)
 Sets the number of agents in the local x- and y-directions. More...
 
void setRotationDeg (float angle)
 Sets the lattice rotation. More...
 
- Public Member Functions inherited from Menge::Agents::AgentGenerator
 AgentGenerator ()
 Constructor.
 
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 Attributes

Vector2 _anchor
 The anchor point of the lattice. One agent will be positioned at this world coordainte.
 
Vector2 _offset
 The offset from one agent to the next agent (along the local x- and y-axes, respectively.
 
size_t _xCount
 The number of agents along the local x-axis.
 
size_t _yCount
 The number of agents along the local y-axis.
 
float _cosRot
 The cosine of the amount the lattice is rotated around its anchor point. positive rotation values are counter-clockwise rotation.
 
float _sinRot
 The sine of the amount the lattice is rotated around its anchor point. positive rotation values are counter-clockwise rotation.
 
- Protected Attributes inherited from Menge::Agents::AgentGenerator
Math::FloatGenerator_disp
 The generator for displacement amount (defaults to zero).
 
Math::FloatGenerator_dir
 The generator for angular displacement.
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::Agents::AgentGenerator
virtual ~AgentGenerator ()
 Virtual destructor.
 

Detailed Description

Definition of an agent generator class which produces agents based on the positions of intersections on a lattice–one agent per intersection.

Member Function Documentation

virtual size_t Menge::Agents::RectGridGenerator::agentCount ( )
inlinevirtual

Reports the number of agents created.

Returns
The number of agents this generator creates.

Implements Menge::Agents::AgentGenerator.

Vector2 Menge::Agents::RectGridGenerator::agentPos ( size_t  i)
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.

Implements Menge::Agents::AgentGenerator.

void Menge::Agents::RectGridGenerator::setAgentCounts ( size_t  xCount,
size_t  yCount 
)
inline

Sets the number of agents in the local x- and y-directions.

Parameters
xCountThe count of agents in the x-direction.
yCountThe count of agents in the y-direction.
void Menge::Agents::RectGridGenerator::setAnchor ( const Vector2 p)
inline

Sets the anchor position.

Parameters
pThe anchor position.
void Menge::Agents::RectGridGenerator::setOffset ( const Vector2 o)
inline

Sets the offset value.

Parameters
oThe offset value.
void Menge::Agents::RectGridGenerator::setRotationDeg ( float  angle)

Sets the lattice rotation.

Parameters
angleThe rotation angle (in degrees).
void Menge::Agents::RectGridGenerator::setXCount ( size_t  count)
inline

Sets the number of agents in the local x-direction.

Parameters
countThe count of agents.
void Menge::Agents::RectGridGenerator::setYCount ( size_t  count)
inline

Sets the number of agents in the local y-direction.

Parameters
countThe count of agents.

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