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 | List of all members
Menge::BFSM::Condition Class Referenceabstract

The base class for transition conditions. More...

#include <Condition.h>

Inheritance diagram for Menge::BFSM::Condition:
Menge::Element Menge::BFSM::AutoCondition Menge::BFSM::Bool2Condition Menge::BFSM::GoalCondition Menge::BFSM::NotCondition Menge::BFSM::SpaceCondition Menge::BFSM::TimerCondition Menge::BFSM::AndCondition Menge::BFSM::OrCondition Menge::BFSM::AABBCondition Menge::BFSM::CircleCondition Menge::BFSM::OBBCondition

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 Conditioncopy ()=0
 Create a copy of this condition. 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 ~Condition ()
 Protected destructor.
 

Detailed Description

The base class for transition conditions.

This class is an abstract class used to define arbitrary conditions for finite-state-machine transitions.

Constructor & Destructor Documentation

Menge::BFSM::Condition::Condition ( const Condition cond)
inline

Copy Constructor.

Parameters
condThe condition to copy from.

Member Function Documentation

virtual bool Menge::BFSM::Condition::conditionMet ( Agents::BaseAgent agent,
const Goal goal 
)
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.

Parameters
agentThe agent to test the transition for.
goalThe agent's goal (although this may be ignored).
Returns
True if the condition has been met, false otherwise.

Implemented in Menge::BFSM::NotCondition, Menge::BFSM::OrCondition, Menge::BFSM::AndCondition, Menge::BFSM::TimerCondition, Menge::BFSM::SpaceCondition, Menge::BFSM::GoalCondition, and Menge::BFSM::AutoCondition.

virtual Condition* Menge::BFSM::Condition::copy ( )
pure virtual

Create a copy of this condition.

It is the responsibility of the caller to delete the object.

Returns
: A "deep copy" of this condition - such that there is no shared objects between this and its copy.

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.

virtual void Menge::BFSM::Condition::onEnter ( Agents::BaseAgent agent)
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.

Parameters
agentThe agent who has entered the state which uses this transition.

Reimplemented in Menge::BFSM::NotCondition, Menge::BFSM::TimerCondition, and Menge::BFSM::Bool2Condition.

virtual void Menge::BFSM::Condition::onLeave ( Agents::BaseAgent agent)
inlinevirtual

Called when an agent exits the state with this transition.

Parameters
agentThe agent who left the state.

Reimplemented in Menge::BFSM::NotCondition, Menge::BFSM::TimerCondition, and Menge::BFSM::Bool2Condition.


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