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

The offset goal selector makes a goal by applying an offset value to the agent's position at assignment time. The offsets can be defined with a distribution. More...

#include <GoalSelectorOffset.h>

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

Public Member Functions

 OffsetGoalSelector ()
 Default constructor.
 
virtual GoalgetGoal (const Agents::BaseAgent *agent) const
 Interface function for acquiring per-agent goals. More...
 
void setDistribution (Vec2DGenerator *gen)
 Set the 2D number distribution for the goal selector. 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 Member Functions

 ~OffsetGoalSelector ()
 Destructor.
 
- 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...
 

Protected Attributes

Vec2DGenerator_2DVel
 A vector distribution for the offset value.
 
- 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.
 

Detailed Description

The offset goal selector makes a goal by applying an offset value to the agent's position at assignment time. The offsets can be defined with a distribution.

Member Function Documentation

Goal * Menge::BFSM::OffsetGoalSelector::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.

void Menge::BFSM::OffsetGoalSelector::setDistribution ( Vec2DGenerator gen)
inline

Set the 2D number distribution for the goal selector.

The goal selector takes ownership of the provided 2D number generator and will delete it upon its own destruction.

Parameters
genA pointer to the 2D generator.

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