Menge
Modular Pedestrian Simulation Framework for Research and Development
|
A velocity component that returns a preferred velocity whose direction and preferred speed are computed from a velocity field. More...
#include <VelCompRoadMap.h>
Public Member Functions | |
RoadMapVelComponent () | |
Default constructor. | |
RoadMapVelComponent (const GraphPtr &graph) | |
Constructor. More... | |
~RoadMapVelComponent () | |
Destructor. | |
void | setRoadMap (const GraphPtr &graph) |
Sets the road map for this velocity component. More... | |
virtual void | onExit (Agents::BaseAgent *agent) |
Called when the agent leaves the state which possesses this velocity component. More... | |
virtual void | setPrefVelocity (const Agents::BaseAgent *agent, const Goal *goal, Agents::PrefVelocity &pVel) |
Computes and sets the agent's preferred velocity. More... | |
virtual VelCompContext * | getContext () |
Provides a display context for interacting with this velocity component. More... | |
Public Member Functions inherited from Menge::BFSM::VelComponent | |
VelComponent () | |
Default constructor. | |
virtual void | onEnter (Agents::BaseAgent *agent) |
Called when the agent enters the state which possesses this velocity component. More... | |
Public Member Functions inherited from Menge::Element | |
void | destroy () |
This supplants the destructor. More... | |
virtual BFSM::Task * | getTask () |
Return an optional task associated with this element. More... | |
virtual SceneGraph::GLNode * | getSGNode () |
Returns an optional visualization element associated with the element. More... | |
Protected Attributes | |
GraphPtr | _roadmap |
The roadmap. | |
PathMap | _paths |
The paths for all agents in this state. | |
ReadersWriterLock | _lock |
Lock to protect _paths;. | |
Friends | |
class | RoadMapVCContext |
Additional Inherited Members | |
Protected Member Functions inherited from Menge::BFSM::VelComponent | |
virtual | ~VelComponent () |
Virtual destructor. | |
A velocity component that returns a preferred velocity whose direction and preferred speed are computed from a velocity field.
If the velocity vector is of unit length, the preferred speed will be unchanged. Otherwise, the preferred speed is scaled by the length of the velocity vector.
Menge::BFSM::RoadMapVelComponent::RoadMapVelComponent | ( | const GraphPtr & | graph | ) |
Constructor.
graph | The graph representing the roadmap. The graph will be destroyed when the velocity component is destroyed. |
|
virtual |
Provides a display context for interacting with this velocity component.
It is the responsibility of the caller to delete the provided context.
Reimplemented from Menge::BFSM::VelComponent.
|
virtual |
Called when the agent leaves the state which possesses this velocity component.
Gives the velocity component to restore any agent-specific data it might have changed.
agent | The agent who left the state. |
Reimplemented from Menge::BFSM::VelComponent.
|
virtual |
Computes and sets the agent's preferred velocity.
The velocity component directly sets preferred velocity values in the the provided preferred velocity instance. See Agents::PrefVelocity for details. Rather than setting the agent's preferred velocity value directly, a reference to a preferred velocity instance is passed in to make the use more general. This allows the computation of the preferred velocity for the agent, without necessarily making changes to it.
agent | The agent for which a preferred velocity is computed. |
goal | The agent's goal (although this may be ignored). |
pVel | The instance of Agents::PrefVelocity to set. |
Implements Menge::BFSM::VelComponent.
|
inline |
Sets the road map for this velocity component.
graph | The graph of the roadmap. |