Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The base class for transition conditions. More...
#include <Condition.h>
Public Member Functions | |
Condition () | |
Constructor. | |
Condition (const Condition &cond) | |
Copy Constructor. More... | |
virtual void | onEnter (Agents::BaseAgent *agent) |
Called when an agent enters a state with this exiting transition. More... | |
virtual void | onLeave (Agents::BaseAgent *agent) |
Called when an agent exits the state with this transition. More... | |
virtual bool | conditionMet (Agents::BaseAgent *agent, const Goal *goal)=0 |
Reports if the conditions have been met. More... | |
virtual Condition * | copy ()=0 |
Create a copy of this condition. 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 Member Functions | |
virtual | ~Condition () |
Protected destructor. | |
The base class for transition conditions.
This class is an abstract class used to define arbitrary conditions for finite-state-machine transitions.
|
inline |
Copy Constructor.
cond | The condition to copy from. |
|
pure virtual |
Reports if the conditions have been met.
This function defines the main functionality of a definition. Given the current agent and its internal state, it determines if the conditions have been met. This should be overridden by each sub-class.
agent | The agent to test the transition for. |
goal | The agent's goal (although this may be ignored). |
Implemented in Menge::BFSM::NotCondition, Menge::BFSM::OrCondition, Menge::BFSM::AndCondition, Menge::BFSM::TimerCondition, Menge::BFSM::SpaceCondition, Menge::BFSM::GoalCondition, and Menge::BFSM::AutoCondition.
|
pure virtual |
Create a copy of this condition.
It is the responsibility of the caller to delete the object.
Implemented in Menge::BFSM::OBBCondition, Menge::BFSM::NotCondition, Menge::BFSM::AABBCondition, Menge::BFSM::OrCondition, Menge::BFSM::CircleCondition, Menge::BFSM::AndCondition, Menge::BFSM::TimerCondition, Menge::BFSM::GoalCondition, and Menge::BFSM::AutoCondition.
|
inlinevirtual |
Called when an agent enters a state with this exiting transition.
Sub-classes should use this function as the opportunity to cache any particular per-agent data.
agent | The agent who has entered the state which uses this transition. |
Reimplemented in Menge::BFSM::NotCondition, Menge::BFSM::TimerCondition, and Menge::BFSM::Bool2Condition.
|
inlinevirtual |
Called when an agent exits the state with this transition.
agent | The agent who left the state. |
Reimplemented in Menge::BFSM::NotCondition, Menge::BFSM::TimerCondition, and Menge::BFSM::Bool2Condition.