WSF
WsfBehaviorTreeLeafNode Class Reference

#include <WsfBehaviorTreeNode.hpp>

Inheritance diagram for WsfBehaviorTreeLeafNode:
Collaboration diagram for WsfBehaviorTreeLeafNode:

Public Member Functions

 WsfBehaviorTreeLeafNode (WsfScenario &aScenario, bool aRegisterPlatformVariable=true, bool aRegisterProcessorVariable=true)
 WsfBehaviorTreeLeafNode (const WsfBehaviorTreeLeafNode &aSrc)
WsfBehaviorTreeLeafNodeoperator= (const WsfBehaviorTreeLeafNode &aRhs)=delete
 ~WsfBehaviorTreeLeafNode () override=default
WsfObjectClone () const override
bool ProcessInput (UtInput &aInput) override
void RegisterInput (UtInput &aInput) override
bool Initialize (double aSimTime, WsfScriptContext *aParentContextPtr) override
bool LocalExecute (double aSimTime) override
void SetTree (WsfBehaviorTree *aTreePtr) override
Public Member Functions inherited from WsfBehaviorTreeNode
 WsfBehaviorTreeNode (const WsfScenario &aScenario)
 WsfBehaviorTreeNode (const WsfBehaviorTreeNode &aSrc)
WsfBehaviorTreeNodeoperator= (const WsfBehaviorTreeNode &)=delete
 ~WsfBehaviorTreeNode () override
bool ProcessInput (UtInput &aInput) override
bool PreconditionsMet ()
double PreconditionValue ()
void AddChild (WsfBehaviorTreeNode *aNodePtr)
std::vector< WsfBehaviorTreeNode * > & Children ()
int ChildCount () const
WsfBehaviorTreeNodeChildEntry (int aIndex)
void SetParent (WsfBehaviorTreeNode *aNodePtr)
WsfBehaviorTreeNodeParent ()
WsfScriptContextGetScriptContext ()
bool Execute (double aSimTime, bool aSkipCheck=false)
void TurnOn ()
void TurnOff ()
void SetFailureReason (const std::string &aReason, bool aSendEvent=false)
std::string FailureReason () const
bool ExecutedLastRun ()
void SetExecutedLastRun (bool aVal)
void SetExecutedLastRunRecursive (bool aVal)
void SetExecutedLastRun (bool aVal, const std::string &aReason)
void SetExecutedLastRunRecursive (bool aVal, const std::string &aReason)
WsfBehaviorTreeOwningTree ()
WsfScriptProcessorOwningProcessor ()
WsfPlatformOwningPlatform ()
WsfSimulationGetSimulation ()
bool TryRunLast (double aSimTime)
bool ShouldRunNext (double aSimTime)
unsigned int Id () const
void LogNodeStructure (double aSimTime, bool aRecurse)
std::string FilePath () const
time_t FileLastModTime () const
void SetFilePath (const std::string &aPath)
void SetFileInfo (const std::string &aPath, time_t aModTime)
WsfBehaviorTreeNodeFindNode (const std::string &aNodeName)
void FindLastExecuted (std::vector< WsfBehaviorTreeNode * > &aLastExecuted)
const char * GetScriptClassName () const override
UtScriptContext * GetScriptAccessibleContext () const override
const WsfScenarioGetScenario () const
virtual bool ProcessMessage (double aSimTime, const WsfMessage &aMessage)
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Protected Member Functions

bool RegisterExternVariable (const std::string &aVariableType, const std::string &aVariableName)
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Additional Inherited Members

Public Types inherited from WsfBehaviorTreeNode
enum  RunType { Repeat , ForTime , UntilDone }
enum  SelectType { Continous , Finite }
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Static Public Member Functions inherited from WsfBehaviorTreeNode
static unsigned int GetUniqueNodeId (void)
static void Reset ()
Protected Attributes inherited from WsfBehaviorTreeNode
const WsfScenariomScenario
bool mInitialized
bool mTurnedOn
WsfBehaviorTreemParentTreePtr
WsfBehaviorTreeNodemParentPtr
std::vector< WsfBehaviorTreeNode * > mChildren
WsfScriptContextmContextPtr
UtScript * mPreconditionScriptPtr
UtScript * mNewExecuteScriptPtr
UtScript * mNewFailScriptPtr
std::string mFailureReason
double mFailureTime
bool mLastExecute
unsigned int mId
std::string mFullPathFileName
time_t mFileLastModTime
RunType mRunType
int mRepeats
double mRunDuration
WsfBehaviorTreeNodemLastNodeSelectedPtr
int mRepeatsLeft
double mRunStartTime
SelectType mSelectType
int mSelectLimit
int mSelectCount
WsfScriptStateMachinemFiniteStateMachinePtr
int mStateIndex
WsfScriptMessageHandlermMessageHandlerPtr
bool mDebug

Constructor & Destructor Documentation

◆ WsfBehaviorTreeLeafNode() [1/2]

WsfBehaviorTreeLeafNode::WsfBehaviorTreeLeafNode ( WsfScenario & aScenario,
bool aRegisterPlatformVariable = true,
bool aRegisterProcessorVariable = true )

◆ WsfBehaviorTreeLeafNode() [2/2]

WsfBehaviorTreeLeafNode::WsfBehaviorTreeLeafNode ( const WsfBehaviorTreeLeafNode & aSrc)

◆ ~WsfBehaviorTreeLeafNode()

WsfBehaviorTreeLeafNode::~WsfBehaviorTreeLeafNode ( )
overridedefault

Member Function Documentation

◆ Clone()

WsfObject * WsfBehaviorTreeLeafNode::Clone ( ) const
overridevirtual

Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.

Implements WsfBehaviorTreeNode.

References WsfBehaviorTreeNode::WsfBehaviorTreeLeafNode, and WsfObject::WsfObject().

◆ Initialize()

◆ LocalExecute()

bool WsfBehaviorTreeLeafNode::LocalExecute ( double aSimTime)
overridevirtual

◆ operator=()

WsfBehaviorTreeLeafNode & WsfBehaviorTreeLeafNode::operator= ( const WsfBehaviorTreeLeafNode & aRhs)
delete

◆ ProcessInput()

bool WsfBehaviorTreeLeafNode::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

References WsfBehaviorTreeNode::AddChild(), WsfBehaviorTreeNode::GetScenario(), WsfBehaviorTreeNode::mContextPtr, WsfBehaviorTreeNode::mParentTreePtr, WsfBehaviorTreeNode::ProcessInput(), WsfObject::SetName(), and WsfBehaviorTreeNode::WsfBehaviorTreeNode().

Referenced by WsfScriptStateMachine::State::ProcessInput().

◆ RegisterExternVariable()

bool WsfBehaviorTreeLeafNode::RegisterExternVariable ( const std::string & aVariableType,
const std::string & aVariableName )
protected

◆ RegisterInput()

void WsfBehaviorTreeLeafNode::RegisterInput ( UtInput & aInput)
overridevirtual

◆ SetTree()

void WsfBehaviorTreeLeafNode::SetTree ( WsfBehaviorTree * aTreePtr)
overridevirtual

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved