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

The nearest nav mesh goal selector selects the goal from a goal set that is nearest to the agent in terms of path length through the navigation mesh. More...

#include <GoalSelectorNearestNM.h>

Inheritance diagram for Menge::BFSM::NearestNMGoalSelector:
Menge::BFSM::SetGoalSelector Menge::BFSM::GoalSelector Menge::Element

Public Member Functions

 NearestNMGoalSelector ()
 Constructor.
 
virtual GoalgetGoal (const Agents::BaseAgent *agent) const
 Interface function for acquiring per-agent goals. More...
 
virtual BFSM::TaskgetTask ()
 Returns a pointer to the nav mesh localizer task. More...
 
void setNavMesh (const NavMeshPtr &nm)
 Sets the navigation mesh pointer. More...
 
NavMeshPtr getNavMesh ()
 Returns a resource pointer to the underlying navigation mesh. More...
 
NavMeshLocalizerPtr getLocalizer ()
 Returns a resource pointer to the underlying navigation mesh localizer. More...
 
void setNavMeshLocalizer (const NavMeshLocalizerPtr &nml)
 Sets the navigation mesh localizer pointer. More...
 
- Public Member Functions inherited from Menge::BFSM::SetGoalSelector
 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...
 
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 SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Attributes

NavMeshPtr _navMesh
 The navigation mesh.
 
NavMeshLocalizerPtr _localizer
 The localizer for the navigation mesh.
 
- Protected Attributes inherited from Menge::BFSM::SetGoalSelector
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.
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::BFSM::SetGoalSelector
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.
 

Detailed Description

The nearest nav mesh goal selector selects the goal from a goal set that is nearest to the agent in terms of path length through the navigation mesh.

Member Function Documentation

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

NavMeshLocalizerPtr Menge::BFSM::NearestNMGoalSelector::getLocalizer ( )
inline

Returns a resource pointer to the underlying navigation mesh localizer.

Returns
The navigation mesh localizer.
NavMeshPtr Menge::BFSM::NearestNMGoalSelector::getNavMesh ( )
inline

Returns a resource pointer to the underlying navigation mesh.

Returns
The navigation mesh.
BFSM::Task * Menge::BFSM::NearestNMGoalSelector::getTask ( )
virtual

Returns a pointer to the nav mesh localizer task.

Returns
A pointer to the nav mesh localizer task. It is the responsibility of the caller to free the memory of the provided task by calling its destroy method.

Reimplemented from Menge::Element.

void Menge::BFSM::NearestNMGoalSelector::setNavMesh ( const NavMeshPtr nm)
inline

Sets the navigation mesh pointer.

Parameters
nmThe managed pointer to the navigation mesh.
void Menge::BFSM::NearestNMGoalSelector::setNavMeshLocalizer ( const NavMeshLocalizerPtr nml)
inline

Sets the navigation mesh localizer pointer.

Parameters
nmlThe managed pointer to the navigation mesh localizer.

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