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 | Friends | List of all members
Menge::BFSM::TimerCondition Class Reference

The definition of the timer condition. More...

#include <CondTimer.h>

Inheritance diagram for Menge::BFSM::TimerCondition:
Menge::BFSM::Condition Menge::Element

Public Member Functions

 TimerCondition ()
 Constructor.
 
 TimerCondition (const TimerCondition &cond)
 Copy Constructor. More...
 
virtual Conditioncopy ()
 Create a copy of this condition. 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)
 The AutoCondition is always met – it is a tautology. More...
 
- Public Member Functions inherited from Menge::BFSM::Condition
 Condition ()
 Constructor.
 
 Condition (const Condition &cond)
 Copy Constructor. 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

 ~TimerCondition ()
 Constructor.
 
- Protected Member Functions inherited from Menge::BFSM::Condition
virtual ~Condition ()
 Protected destructor.
 

Protected Attributes

std::map< size_t, float > _triggerTimes
 The trigger time for agents currently effected by this transition.
 
FloatGenerator_durGen
 The generator for determining the per-agent duration.
 
ReadersWriterLock _lock
 Lock to protect _triggerTimes;.
 

Friends

class TimerCondFactory
 

Detailed Description

The definition of the timer condition.

The time condition becomes active when the agent has been in the state at least the amount of time specified by the transition properties. The amount of time can be specified globally or per agent and, in the case of a per-agent duration, can be specified using the value distributions (FloatGenerator).

Constructor & Destructor Documentation

Menge::BFSM::TimerCondition::TimerCondition ( const TimerCondition cond)

Copy Constructor.

Parameters
condThe condition to copy from.

Member Function Documentation

bool Menge::BFSM::TimerCondition::conditionMet ( Agents::BaseAgent agent,
const Goal goal 
)
virtual

The AutoCondition is always met – it is a tautology.

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.

Implements Menge::BFSM::Condition.

Condition * Menge::BFSM::TimerCondition::copy ( )
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.

Implements Menge::BFSM::Condition.

void Menge::BFSM::TimerCondition::onEnter ( Agents::BaseAgent agent)
virtual

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 from Menge::BFSM::Condition.

void Menge::BFSM::TimerCondition::onLeave ( Agents::BaseAgent agent)
virtual

Called when an agent exits the state with this transition.

Parameters
agentThe agent who left the state.

Reimplemented from Menge::BFSM::Condition.


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