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::BFSM::MirrorGoalSelector Class Reference

The mirror goal selector makes a goal by reflecting the agent's position around the world's origin. The reflection across the x- and y-axes can be individually specified. More...

#include <GoalSelectorMirror.h>

Inheritance diagram for Menge::BFSM::MirrorGoalSelector:
Menge::BFSM::GoalSelector Menge::Element

Public Member Functions

 MirrorGoalSelector ()
 Default constructor.
 
virtual GoalgetGoal (const Agents::BaseAgent *agent) const
 Interface function for acquiring per-agent goals. More...
 
void setMirror (bool mirrorX, bool mirrorY)
 Sets the mirroring of the goal selector. More...
 
void setMirrorX (bool mirror)
 Sets the x-mirroring of the goal selector. More...
 
void setMirrorY (bool mirror)
 Sets the y-mirroring of the goal selector. More...
 
bool getMirrorX () const
 Returns the mirror x state. More...
 
bool getMirrorY () const
 Returns the mirror y state. More...
 
- Public Member Functions inherited from Menge::BFSM::GoalSelector
 GoalSelector ()
 Default constructor.
 
GoalassignGoal (const Agents::BaseAgent *agent)
 Uses the goal selector to assign a goal to the given agent. More...
 
void freeGoal (const Agents::BaseAgent *agent, Goal *goal)
 Informs the goal selector that the agent is done with the goal. More...
 
virtual void setGoalSet (std::map< size_t, GoalSet * > &goalSets)
 Gives the instance the opportunity to set the goal set. More...
 
void setPersistence (bool state)
 Sets the persistence of the goal. More...
 
bool getPersistence () const
 Reports the persistence of the goal. 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

bool _mirrorX
 Determines if the agent's position is reflected over the x-axis (true) or not (false).
 
bool _mirrorY
 Determines if the agent's position is reflected over the y-axis (true) or not (false).
 
- Protected Attributes inherited from Menge::BFSM::GoalSelector
bool _persistent
 Determines if the GoalSelector maintains persistent goals. More...
 
HASH_MAP< size_t, Goal * > _assignedGoals
 A mapping from agent id to assigned goals. This will only contain meaningful values in one of two cases: More...
 
ReadersWriterLock _lock
 The lock to maintain readers-writer access to the _assignedGoals.
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::BFSM::GoalSelector
virtual ~GoalSelector ()
 Default virtual destructor.
 
virtual void lockResources ()
 Allows the goal selector to lock any resources it requires. More...
 
virtual void releaseResources ()
 Allows the goal selector to release previously locked resources. More...
 

Detailed Description

The mirror goal selector makes a goal by reflecting the agent's position around the world's origin. The reflection across the x- and y-axes can be individually specified.

Setting the mirror settings to not reflect over either axis is akin to creating the IdentityGoalSelector.

Member Function Documentation

Goal * Menge::BFSM::MirrorGoalSelector::getGoal ( const Agents::BaseAgent agent) const
virtual

Interface function for acquiring per-agent goals.

Parameters
agentThe agent for whom a goal is extracted.
Returns
A pointer to a goal. // TODO: Figure out who owns this goal.

Implements Menge::BFSM::GoalSelector.

bool Menge::BFSM::MirrorGoalSelector::getMirrorX ( ) const
inline

Returns the mirror x state.

Returns
The mirror x state of the selector.
bool Menge::BFSM::MirrorGoalSelector::getMirrorY ( ) const
inline

Returns the mirror y state.

Returns
The mirror y state of the selector.
void Menge::BFSM::MirrorGoalSelector::setMirror ( bool  mirrorX,
bool  mirrorY 
)
inline

Sets the mirroring of the goal selector.

Parameters
mirrorXDetermines if the position is mirrored over the x-axis.
mirrorYDetermines if the position is mirrored over the y-axis.
void Menge::BFSM::MirrorGoalSelector::setMirrorX ( bool  mirror)
inline

Sets the x-mirroring of the goal selector.

Parameters
mirrorDetermines if the position is mirrored over the axis.
void Menge::BFSM::MirrorGoalSelector::setMirrorY ( bool  mirror)
inline

Sets the y-mirroring of the goal selector.

Parameters
mirrorDetermines if the position is mirrored over the axis.

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