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::SetGoalSelector Class Reference

This is a base class – not to be instantiated. It provides the functional basis for GoalSelectors which use a GoalSet as the underlying data structure. More...

#include <GoalSelectorSet.h>

Inheritance diagram for Menge::BFSM::SetGoalSelector:
Menge::BFSM::GoalSelector Menge::Element Menge::BFSM::FarthestGoalSelector Menge::BFSM::FarthestNMGoalSelector Menge::BFSM::NearestGoalSelector Menge::BFSM::NearestNMGoalSelector Menge::BFSM::RandomGoalSelector Menge::BFSM::WeightedGoalSelector

Public Member Functions

 SetGoalSelector ()
 Default constructor.
 
void setGoalSet (std::map< size_t, GoalSet * > &goalSets)
 Gives the instance the opportunity to set the goal set. More...
 
void setGoalSetID (size_t id)
 Sets the goal set identifier. 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 GoalgetGoal (const Agents::BaseAgent *agent) const =0
 Interface function for acquiring per-agent goals. 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

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 Member Functions inherited from Menge::BFSM::GoalSelector
virtual ~GoalSelector ()
 Default virtual destructor.
 

Protected Attributes

union {
   size_t   _goalSetID
 The identifier for the goal set.
 
   GoalSet *   _goalSet
 The pointer to the goal set.
 
}; 
 The goal set associated with this goal selector. During parsing, it contains the id of the goal set. After FSM construction, it contains a pointer to the actual goal set.
 
- 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

This is a base class – not to be instantiated. It provides the functional basis for GoalSelectors which use a GoalSet as the underlying data structure.

Member Function Documentation

virtual void Menge::BFSM::SetGoalSelector::lockResources ( )
inlineprotectedvirtual

Allows the goal selector to lock any resources it requires.

This is primarily here so that GoalSelectors which use shared resources have a chance to lock them (see SetGoalSelector). A call to lockResources should always be followed by a call to releeaseResources.

Reimplemented from Menge::BFSM::GoalSelector.

virtual void Menge::BFSM::SetGoalSelector::releaseResources ( )
inlineprotectedvirtual

Allows the goal selector to release previously locked resources.

Should be used in conjunction with lockResources.

Reimplemented from Menge::BFSM::GoalSelector.

void Menge::BFSM::SetGoalSelector::setGoalSet ( std::map< size_t, GoalSet * > &  goalSets)
virtual

Gives the instance the opportunity to set the goal set.

This does nothing for instances which don't require a goal set. Otherwise, it extracts its required goal set.

Parameters
goalSetsA mapping from goal set identifier to goal set pointers.

Reimplemented from Menge::BFSM::GoalSelector.

void Menge::BFSM::SetGoalSelector::setGoalSetID ( size_t  id)
inline

Sets the goal set identifier.

Parameters
idThe goal set's id that belongs to this selector.

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