45 #ifndef __RECT_GRID_GENERATOR_H__
46 #define __RECT_GRID_GENERATOR_H__
48 #include "mengeCommon.h"
72 virtual size_t agentCount() {
return _xCount * _yCount; }
81 virtual Vector2 agentPos(
size_t i );
117 void setAgentCounts(
size_t xCount,
size_t yCount ) { _xCount = xCount; _yCount = yCount; }
124 void setRotationDeg(
float angle );
183 virtual const char *
name()
const {
return "rect_grid"; }
193 return "Agent generation is done via the specification of a rectangular grid.";
227 virtual bool setFromXML(
AgentGenerator * gen, TiXmlElement * node,
const std::string & specFldr )
const;
267 #endif // __RECT_GRID_GENERATOR_H__
size_t _rotID
The identifier for the "rotation" float parameter.
Definition: RectGridGenerator.h:262
size_t _offsetXID
The identifier for the "offset_x" float parameter.
Definition: RectGridGenerator.h:242
The factory for parsing xml data and instantiating agent generator implementations.
virtual size_t agentCount()
Reports the number of agents created.
Definition: RectGridGenerator.h:72
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
size_t _xCountID
The identifier for the "count_x" size_t parameter.
Definition: RectGridGenerator.h:252
float _cosRot
The cosine of the amount the lattice is rotated around its anchor point. positive rotation values are...
Definition: RectGridGenerator.h:153
The base class inital agent generation.
Definition: AgentGenerator.h:104
AgentGenerator * instance() const
Create an instance of this class's agent generator implementation.
Definition: RectGridGenerator.h:207
Vector2 _anchor
The anchor point of the lattice. One agent will be positioned at this world coordainte.
Definition: RectGridGenerator.h:131
virtual const char * name() const
The name of the generator type.
Definition: RectGridGenerator.h:183
void setAnchor(const Vector2 &p)
Sets the anchor position.
Definition: RectGridGenerator.h:88
virtual const char * description() const
A description of the agent generator.
Definition: RectGridGenerator.h:192
float _sinRot
The sine of the amount the lattice is rotated around its anchor point. positive rotation values are c...
Definition: RectGridGenerator.h:159
size_t _yCountID
The identifier for the "count_y" size_t parameter.
Definition: RectGridGenerator.h:257
Vector2 _offset
The offset from one agent to the next agent (along the local x- and y-axes, respectively.
Definition: RectGridGenerator.h:137
Definition of an agent generator class which produces agents based on the positions of intersections ...
Definition: RectGridGenerator.h:60
size_t _xCount
The number of agents along the local x-axis.
Definition: RectGridGenerator.h:142
Factory for RectGridGenerator.
Definition: RectGridGenerator.h:168
size_t _anchorYID
The identifier for the "anchor_y" float parameter.
Definition: RectGridGenerator.h:237
void setOffset(const Vector2 &o)
Sets the offset value.
Definition: RectGridGenerator.h:95
void setAgentCounts(size_t xCount, size_t yCount)
Sets the number of agents in the local x- and y-directions.
Definition: RectGridGenerator.h:117
size_t _offsetYID
The identifier for the "offset_y" float parameter.
Definition: RectGridGenerator.h:247
A class for parsing the xml description of an agent generator and instantiating particular instances...
Definition: AgentGeneratorFactory.h:59
The definition of the agent generator element. Defines the intial numbers and positions of agents in ...
void setYCount(size_t count)
Sets the number of agents in the local y-direction.
Definition: RectGridGenerator.h:109
The namespace that contains the basic simulation mechanisms.
size_t _anchorXID
The identifier for the "anchor_x" float parameter.
Definition: RectGridGenerator.h:232
size_t _yCount
The number of agents along the local y-axis.
Definition: RectGridGenerator.h:147
void setXCount(size_t count)
Sets the number of agents in the local x-direction.
Definition: RectGridGenerator.h:102