141 State(
const std::string & name );
357 #endif //__FSMNODE_H__
The transition between BFSM states.
Definition: Transition.h:67
The basic state of the behavior finite state machine.
Definition: State.h:123
GoalSelector * getGoalSelector()
Returns a pointer to the goal selector.
Definition: State.h:277
HASH_MAP< size_t, Goal * > _goals
A mapping from agent id to its per-agent goal.
Definition: State.h:337
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
virtual void leave(Agents::BaseAgent *agent)
Automatically called when an agent leaves the state.
Definition: State.cpp:188
std::vector< VelModifier * > velModifiers_
A priority-ordered list of velocity modifiers to determine if the state changes. The order of the mod...
Definition: State.h:317
void getPrefVelocity(Agents::BaseAgent *agent, Agents::PrefVelocity &velocity)
Modifies the input preferred velocity to reflect a velocity for the agent specified.
Definition: State.cpp:99
void getTasks(FSM *fsm)
Gets the tasks for all of the state's FSM elements.
Definition: State.cpp:77
The definition of a preferred velocity.
The definition of actions that are taken as agents enter states.
The definition of a readers-writer lock.
Definition: ReadersWriterLock.h:62
The base class for computing an agent's preferred velocity.
Definition: VelComponent.h:112
The definition of how preferred velocity is modified by a filter.
Exception class for BFSM states.
Definition: State.h:72
The base definition for exceptions in Menge.
VelComponent * _velComponent
The single velocity component associated with this state.
Definition: State.h:305
Base context for finite state machine states.
Definition: StateContext.h:80
~State()
Destructor.
Definition: State.cpp:64
State(const std::string &name)
Constructor.
Definition: State.cpp:58
State * testTransitions(Agents::BaseAgent *agent)
Test the transitions out of this state for the given agent.
Definition: State.cpp:118
void setVelComponent(VelComponent *vc)
Sets the velocity component to the state.
Definition: State.h:222
The definition of state transitions in the BFSM.
Base exception class for menge operations.
Definition: MengeException.h:58
void addAction(Action *a)
Add an action to the state.
Definition: State.h:229
std::string getName() const
Returns the name of the state.
Definition: State.h:253
size_t getID() const
Returns the globally unique state identifier.
Definition: State.h:246
void setFinal(bool isFinal)
Set whether the state is final or not.
Definition: State.h:168
Templated class for the behavior finite state machine.
Definition: FSM.h:126
void setGoalSelector(GoalSelector *selector)
Sets the goal selector for the state.
Definition: State.cpp:223
The definition of a readers-writer lock.
std::string _name
The name of the state.
Definition: State.h:342
Base class for fatal exceptions.
Definition: MengeException.h:99
Exception thrown when the state has an error which cannot be recovered from.
Definition: State.h:92
The namespace contains the Behavior Finite State Machine (BFSM) definition.
void clearGoalSelector()
Clears the state's current goal selector.
Definition: State.cpp:233
StateException(const std::string &s)
Constructor with message.
Definition: State.h:84
The abstract definition of an action.
Definition: Action.h:78
The definition of how preferred velocity is computed in a state.
The definition of a preferred velocity.
Definition: PrefVelocity.h:68
Defines the basic agent properties and functionality that all simulation agents share.
Definition: BaseAgent.h:123
Enumerated types for the State class.
The base, abstract class for selecting per-agent goals.
Definition: GoalSelector.h:113
The base class for modifying preferred velocities.
Definition: VelModifier.h:110
size_t getPopulation() const
Returns the number of agents in this state.
Definition: State.cpp:210
std::vector< Action * > actions_
Actions to take upon entering and leaving the state.
Definition: State.h:322
StateFatalException(const std::string &s)
Constructor with message.
Definition: State.h:104
GoalSelector * _goalSelector
The goal selector for this state.
Definition: State.h:332
void addTransition(Transition *t)
Add a transition to the state.
Definition: State.h:212
StateFatalException()
Default constructor.
Definition: State.h:97
void addVelModifier(VelModifier *v)
Add an velocity modifier to the state.
Definition: State.h:236
ReadersWriterLock _goalLock
The lock for accessing the goals.
Definition: State.h:352
std::vector< Transition * > transitions_
A priority-ordered list of transitions to determine if the state changes. The order of the transition...
Definition: State.h:311
virtual void enter(Agents::BaseAgent *agent)
Automatically called when an agent enters the state.
Definition: State.cpp:158
bool getFinal() const
Reports if the state is final or not.
Definition: State.h:175
bool _final
Determines if the state is a final state (true), or not (false).
Definition: State.h:327
StateException()
Default constructor.
Definition: State.h:77
size_t _id
The globally unique id of state.
Definition: State.h:347