|
WSF
|
#include <WsfScriptStateMachine.hpp>

Public Member Functions | |
| State ()=default | |
| State (WsfStringId aStateName, WsfScriptContext &aContext) | |
| State (const State &aSrc)=delete | |
| const State & | operator= (const State &aRhs)=delete |
| virtual | ~State () |
| virtual State * | Clone (WsfScriptContext &aContext) const |
| virtual std::unique_ptr< Transition > | CreateTransition (WsfStringId aNextStateName) const |
| virtual void | RemoveTransition (WsfStringId aNextStateName) |
| Removes the specified transition from the state. | |
| TransitionList & | GetTransitions () |
| virtual void | EnterState () |
| Execute the script associated with entering the state. | |
| virtual int | Evaluate (bool aShowStateEvaluations) |
| virtual void | ExitState () |
| Execute the script associated with exiting the state. | |
| int | GetStateIndex () const |
| void | SetStateIndex (int aStateIndex) |
| Set the state index of this state within the state machine. | |
| WsfStringId | GetStateName () const |
| Return the name (ID) of this state. | |
| virtual bool | Initialize (double aSimTime, WsfScriptStateMachine &aStateMachine, WsfScriptContext &aContext) |
| virtual bool | ProcessInput (UtInput &aInput, WsfStringId aNameSpace=nullptr) |
| const WsfScenario * | GetScenario () const |
| WsfScriptStateMachine * | ChildStateMachine () |
| int | ChildStateIndex () |
| void | SetChildStateIndex (int stateIndex) |
| WsfAdvancedBehaviorTree * | AdvancedBehaviorTree () const |
Protected Member Functions | |
| State (const State &aSrc, WsfScriptContext &aContext) | |
Protected Attributes | |
| WsfStringId | mStateName |
| The name (ID) of this state. | |
| int | mStateIndex {0} |
| The index of this state within the state machine. | |
| WsfScriptContext * | mContextPtr {nullptr} |
| The script context. | |
| UtScript * | mOnEntryScriptPtr {nullptr} |
| WsfStringId | mOnEntryScriptName |
| UtScript * | mOnExitScriptPtr {nullptr} |
| WsfStringId | mOnExitScriptName |
| TransitionList | mTransitionList |
| The rules that provide for transitions out of this state. | |
| WsfBehaviorTree * | mBehaviorTreePtr {nullptr} |
| ut::CloneablePtr< WsfAdvancedBehaviorTree > | mAdvancedBehaviorTreePtr {nullptr} |
| WsfScriptStateMachine * | mChildFiniteStateMachinePtr {nullptr} |
| int | mChildStateIndex {0} |
A 'State' represents an allowable state within the machine. It consists of a set of transitions as well as methods that are called on entry and exit from the state.
|
default |
References State().
Referenced by Clone(), Initialize(), operator=(), State(), State(), and State().
|
explicit |
|
delete |
References State().
|
virtual |
References mBehaviorTreePtr, and mChildFiniteStateMachinePtr.
|
protected |
|
inline |
References mAdvancedBehaviorTreePtr.
Referenced by UT_DEFINE_SCRIPT_METHOD().
|
inline |
References mChildStateIndex.
Referenced by WsfScriptProcessor::SetStateAll(), and WsfScriptProcessor::StateAll().
|
inline |
References mChildFiniteStateMachinePtr, and WsfScriptStateMachine::WsfScriptStateMachine().
Referenced by WsfScriptProcessor::SetStateAll(), and WsfScriptProcessor::StateAll().
|
virtual |
Create a clone of the state. This must be provided by a derived class if they extend State.
References State().
Referenced by operator=().
|
virtual |
A virtual constructor for Transition objects. This must be provided by derived classes if they extend Transition.
Referenced by operator=(), and ProcessInput().
|
virtual |
Execute the script associated with entering the state.
References mChildFiniteStateMachinePtr, mChildStateIndex, mContextPtr, mOnEntryScriptPtr, and WsfObserver::StateMachineState().
Referenced by WsfScriptStateMachine::EnterState().
|
virtual |
Evaluate the transition rules associated with the state. The rules are evaluated in the order in which they are defined. Control returns to the caller when the first rule that would cause a transition is detected.
References WsfScriptStateMachine::GetStateName(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mChildFiniteStateMachinePtr, mChildStateIndex, mContextPtr, mStateIndex, and mTransitionList.
Referenced by WsfScriptStateMachine::Evaluate(), and WsfScriptStateMachine::EvaluateState().
|
virtual |
Execute the script associated with exiting the state.
References mContextPtr, and mOnExitScriptPtr.
Referenced by WsfScriptStateMachine::ExitState().
| const WsfScenario * WsfScriptStateMachine::State::GetScenario | ( | ) | const |
References mContextPtr.
|
inline |
Return the index of this state within the state machine.
References mStateIndex.
Referenced by WsfScriptStateMachine::EnterState(), WsfScriptStateMachine::Evaluate(), WsfScriptStateMachine::EvaluateState(), WsfScriptStateMachine::ExitState(), WsfScriptStateMachine::GetStateIndex(), and Initialize().
|
inline |
Return the name (ID) of this state.
References mStateName.
Referenced by WsfScriptStateMachine::EnterState(), WsfScriptStateMachine::ExitState(), WsfScriptStateMachine::GetStateName(), and UT_DEFINE_SCRIPT_METHOD().
|
inline |
References mTransitionList.
|
virtual |
Initialize the state.
| aSimTime | The current simulation time. |
| aStateMachine | The state machine with which the state is associated. |
| aParentContext | The script context to which this state context is to be attached. |
References WsfScriptStateMachine::FindState(), GetStateIndex(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mChildFiniteStateMachinePtr, mContextPtr, mOnEntryScriptName, mOnEntryScriptPtr, mOnExitScriptName, mOnExitScriptPtr, mStateName, mTransitionList, ok, WsfScriptStateMachine::Processor(), State(), and WsfScriptStateMachine::WsfScriptStateMachine().
References Clone(), CreateTransition(), RemoveTransition(), and State().
|
virtual |
Process input for the state.
| aInput | The input stream. |
| aNameSpace | The string name ID of the state namespace |
References CreateTransition(), WsfScenario::FromInput(), WsfObject::GetType(), mAdvancedBehaviorTreePtr, mBehaviorTreePtr, mChildFiniteStateMachinePtr, mContextPtr, mOnEntryScriptName, mOnExitScriptName, mStateName, mTransitionList, WsfAdvancedBehaviorTreeLeafNode::ProcessInput(), WsfBehaviorTreeLeafNode::ProcessInput(), and WsfScriptStateMachine::WsfScriptStateMachine().
Referenced by WsfScriptProcessor::ProcessInput().
|
virtual |
Removes the specified transition from the state.
References mTransitionList.
Referenced by operator=().
| void WsfScriptStateMachine::State::SetChildStateIndex | ( | int | stateIndex | ) |
References mChildFiniteStateMachinePtr, and mChildStateIndex.
Referenced by WsfScriptProcessor::SetStateAll().
|
inline |
Set the state index of this state within the state machine.
References mStateIndex.
|
protected |
Referenced by AdvancedBehaviorTree(), Evaluate(), Initialize(), ProcessInput(), and State().
|
protected |
Referenced by Evaluate(), Initialize(), ProcessInput(), State(), State(), and ~State().
|
protected |
Referenced by ChildStateMachine(), EnterState(), Evaluate(), Initialize(), ProcessInput(), SetChildStateIndex(), State(), State(), and ~State().
|
protected |
Referenced by ChildStateIndex(), EnterState(), Evaluate(), SetChildStateIndex(), State(), and State().
|
protected |
The script context.
Referenced by EnterState(), Evaluate(), ExitState(), GetScenario(), Initialize(), ProcessInput(), State(), and State().
|
protected |
Referenced by Initialize(), ProcessInput(), State(), and State().
|
protected |
The script to be executed when entering the state. Note that this script is 'owned' by the script context under which it was compiled.
Referenced by EnterState(), Initialize(), State(), and State().
|
protected |
Referenced by Initialize(), ProcessInput(), State(), and State().
|
protected |
The script to be executed when exiting the state. Note that this script is 'owned' by the script context under which it was compiled.
Referenced by ExitState(), Initialize(), State(), and State().
|
protected |
The index of this state within the state machine.
Referenced by Evaluate(), GetStateIndex(), SetStateIndex(), State(), and State().
|
protected |
The name (ID) of this state.
Referenced by GetStateName(), Initialize(), ProcessInput(), State(), and State().
|
protected |
The rules that provide for transitions out of this state.
Referenced by Evaluate(), GetTransitions(), Initialize(), ProcessInput(), RemoveTransition(), State(), and State().