WSF
WsfAdvancedBehaviorTreeNode Class Referenceabstract

#include <WsfAdvancedBehaviorTreeNode.hpp>

Inheritance diagram for WsfAdvancedBehaviorTreeNode:
Collaboration diagram for WsfAdvancedBehaviorTreeNode:

Public Member Functions

 WsfAdvancedBehaviorTreeNode (const WsfScenario &aScenario)
 WsfAdvancedBehaviorTreeNode (const WsfAdvancedBehaviorTreeNode &aSrc)
 ~WsfAdvancedBehaviorTreeNode () override
WsfAdvancedBehaviorTreeNodeoperator= (const WsfAdvancedBehaviorTreeNode &)=delete
virtual void AddChild (std::shared_ptr< WsfAdvancedBehaviorTreeNode > aNodePtr)
 Add a child to this node.
virtual void AddTree (ut::CloneablePtr< WsfAdvancedBehaviorTree > &aTreePtr)
 Add a tree child to this node.
virtual std::vector< std::shared_ptr< WsfAdvancedBehaviorTreeNode > > & GetChildren ()
 Return a list of current children held by this node.
virtual std::map< size_t, ut::CloneablePtr< WsfAdvancedBehaviorTree > > & GetTrees ()
 Return a list of current children trees held by this node.
virtual void OutputTreeStructures (const double aSimTime)
 Output this nodes children trees structures to the event pipe.
virtual void OutputTreeStates (const double aSimTime)
 Output this nodes tree states to the event pipe if they are outputting.
WsfAdvancedBehaviorTreeNodeClone () const override=0
 Clone this node.
virtual const int GetDepth () const
 Get the depth of this node.
const time_t & GetFileLastModTime () const
 Return the last time the script this node was declared in was modified.
const std::string & GetFilePath () const
 Return the file path to the script this node was declared in.
std::shared_ptr< WsfAttributeContainerGetBlackboard ()
 Return a pointer to the blackboard for this node.
const std::string & GetNodeName () const
 Get the name of this node.
void SetNodeName (const std::string &aName)
 Set the name of this node.
const std::string & GetDescription () const
 Get the description of this node.
void SetDescription (const std::string &aDesc)
 Set the description of this node.
const BT::ReturnStatusGetNodeStatus () const
 Get the ReturnStatus of this node.
const WsfScenarioGetScenario () const
 Return the current scenario.
const char * GetScriptClassName () const override
 Return the script class name for this node.
const WsfScriptContextGetScriptContext () const
 Returns a reference to the script context for this node.
WsfSimulationGetSimulation () const
 Return a pointer to the simulation.
const std::string & GetPreconditionTooltip () const
 Return the current precondition tooltip text for this node.
const std::string & GetExecuteTooltip () const
 Return the current execute tooltip text for this node.
const bool & GetTurnedOn () const
 Returns if this node is on.
virtual void Halt (const std::string &aReason)
 Halt the execution of this node.
virtual void HaltChildren (unsigned int aIndex, const std::string &aReason)
 Halt the execution of this node's children starting at an index.
virtual const bool HasChildrenContainer () const
 Get if this node can have children.
const bool & HasParent () const
 Get if this node has a parent.
const unsigned int & Id () const
 Return the unique id for this node.
const UtColor & GetColor () const
 Return this node's color.
bool HasDefinedColor () const
 Return the string representation of this node's color.
virtual bool Initialize (double aSimTime, WsfScriptContext *aParentContextPtr)
 Initializes this node.
WsfPlatformGetOwningPlatform () const
 Return a pointer to the owning platform of this node.
WsfScriptProcessorGetOwningProcessor () const
 Return a pointer to the owning processor of this node.
WsfAdvancedBehaviorTreeGetOwningTree () const
 Return a pointer to the owning tree of this node.
WsfAdvancedBehaviorTreeNodeGetParent () const
 Returns a pointer to the current parent of this node.
const bool PreconditionsMet () const
 Returns a boolean representing if the precondition ran successfully or not.
virtual const double PreconditionValue () const
 Returns a fitness value representing how well the precondition ran.
bool ProcessInput (UtInput &aInput) override
 Process input from a script.
virtual bool ProcessMessage (double aSimTime, const WsfMessage &aMessage)
 Process a script message.
virtual void RegisterInput (UtInput &aInput)
 Register a file path and last modified time from an input.
virtual void ResetPreconditionVars ()
 Reset the precondition ran and met var to false at the beginning of the tree tick.
void SetFilePath (const std::string &aPath)
 Set the file path for this node.
void SetHasParent (const bool aValue)
 Set if this node has a parent.
void SetParent (WsfAdvancedBehaviorTreeNode *aNodePtr)
 Set the parent of this node.
void SetTooltip (const std::string &aText, const bool aSendEvent=false)
 Set the tooltip text for this node.
void SetPreconditionTooltip (const std::string &aText, const bool aSendEvent=false)
 Set the tooltip text for this node.
void SetExecuteTooltip (const std::string &aText, const bool aSendEvent=false)
 Set the tooltip text for this node.
virtual void SetTree (WsfAdvancedBehaviorTree *aTreePtr)
 Set the owning tree for this node.
virtual BT::ReturnStatus Tick ()
 Tick forward and update the execution of this node.
virtual BT::ReturnStatus TickFunction ()
 This is the functionality ran by each node, e.g how the node handles its tick.
virtual void TurnOff ()
 Turns this node off.
virtual void TurnOn ()
 Turns this node on.
bool ExecutedLastTick () const
WsfAdvancedBehaviorTreeNodeFindNode (const std::string &aNodeName)
 Find the node based on the script-configured name.
void FindLastExecuted (std::vector< WsfAdvancedBehaviorTreeNode * > &aLastExecuted)
 Find and return all nodes exectued last tick.
void SetIsTreeRootNode (const bool aState)
 Set if this node is the root node for a tree.
bool GetIsTreeRootNode () const
 Get if this tree is a root node for a tree.
WsfScriptStateMachineChildStateMachine ()
WsfAdvancedBehaviorTreeNodeGetTopRootNode ()
 Get the top-most root node (ignore nodes considered as tree root nodes).
UtScript * GetExecuteScript ()
 Return a pointer to the execute script for this node.
void SetInitScript (UtScript *aScriptPtr)
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)

Static Public Member Functions

static unsigned int GetUniqueNodeId ()
 Get a unique int id for this node.
static void Reset ()
 Reset the unique int counter.

Protected Member Functions

bool RegisterExternVariable (const std::string &aVariableType, const std::string &aVariableName)
 Register an external variable.
UtScriptContext * GetScriptAccessibleContext () const override
 Return the context from the script.
void SetFileInfo (const std::string &aPath, const time_t &aModTime)
 Set the file path and last mod time for this node.
void SetNodeStatus (const BT::ReturnStatus aStatus)
 Set the ReturnStatus of this node.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Protected Attributes

unsigned int mId {0}
const WsfScenariomScenario
std::shared_ptr< WsfAttributeContainermBlackboard
WsfScriptContextmContextPtr {nullptr}
WsfScriptMessageHandlermMessageHandlerPtr {nullptr}
WsfAdvancedBehaviorTreeNodemParentPtr {nullptr}
WsfAdvancedBehaviorTreemParentTreePtr {nullptr}
WsfScriptStateMachinemFiniteStateMachinePtr {nullptr}
int mStateIndex {0}
time_t mFileLastModTime
bool mDebug {false}
bool mInitialized {false}
bool mTurnedOn {true}
bool mIsTreeRootNode {false}
bool mHasParent {false}
bool mExecutedLastTick {false}
bool mInPrecondition {false}
bool mPreconditionRan {false}
bool mPreconditionMet {false}
BT::ReturnStatus mReturnStatus {BT::cIDLE}
std::string mFullPathFileName {""}
std::string mName {""}
std::string mDescription {""}
std::string mPreconditionTooltip {""}
std::string mExecuteTooltip {""}
double mPreconditionTooltipTimestamp {-1.0}
double mExecuteTooltipTimestamp {-1.0}
UtScript * mOnInitScriptPtr {nullptr}
UtScript * mNewExecuteScriptPtr {nullptr}
UtScript * mNewFailScriptPtr {nullptr}
UtScript * mPreconditionScriptPtr {nullptr}
UtScript * mExecuteScriptPtr {nullptr}
UtColor mColor
bool mHasDefinedColor

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.

Constructor & Destructor Documentation

◆ WsfAdvancedBehaviorTreeNode() [1/2]

◆ WsfAdvancedBehaviorTreeNode() [2/2]

◆ ~WsfAdvancedBehaviorTreeNode()

WsfAdvancedBehaviorTreeNode::~WsfAdvancedBehaviorTreeNode ( )
override

Member Function Documentation

◆ AddChild()

virtual void WsfAdvancedBehaviorTreeNode::AddChild ( std::shared_ptr< WsfAdvancedBehaviorTreeNode > aNodePtr)
inlinevirtual

Add a child to this node.

Parameters
aNodePtrchild node to add.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeDecoratorNode.

◆ AddTree()

virtual void WsfAdvancedBehaviorTreeNode::AddTree ( ut::CloneablePtr< WsfAdvancedBehaviorTree > & aTreePtr)
inlinevirtual

Add a tree child to this node.

Parameters
aTreePtrtree to add.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeDecoratorNode.

◆ ChildStateMachine()

WsfScriptStateMachine * WsfAdvancedBehaviorTreeNode::ChildStateMachine ( )
inline

◆ Clone()

◆ ExecutedLastTick()

bool WsfAdvancedBehaviorTreeNode::ExecutedLastTick ( ) const
inline

References mExecutedLastTick.

Referenced by FindLastExecuted().

◆ FindLastExecuted()

void WsfAdvancedBehaviorTreeNode::FindLastExecuted ( std::vector< WsfAdvancedBehaviorTreeNode * > & aLastExecuted)

Find and return all nodes exectued last tick.

Parameters
aLastExecutedcontainer to fill with node pointers.

References ExecutedLastTick(), HasChildrenContainer(), and WsfAdvancedBehaviorTreeNode().

◆ FindNode()

WsfAdvancedBehaviorTreeNode * WsfAdvancedBehaviorTreeNode::FindNode ( const std::string & aNodeName)

Find the node based on the script-configured name.

Parameters
aNodeNamenode name to find.
Returns
The pointer to the node is returned if found otherwise a nullptr is returned.

References WsfObject::GetName(), HasChildrenContainer(), and WsfAdvancedBehaviorTreeNode().

◆ GetBlackboard()

std::shared_ptr< WsfAttributeContainer > WsfAdvancedBehaviorTreeNode::GetBlackboard ( )
inline

Return a pointer to the blackboard for this node.

References mBlackboard.

◆ GetChildren()

virtual std::vector< std::shared_ptr< WsfAdvancedBehaviorTreeNode > > & WsfAdvancedBehaviorTreeNode::GetChildren ( )
inlinevirtual

Return a list of current children held by this node.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode.

◆ GetColor()

const UtColor & WsfAdvancedBehaviorTreeNode::GetColor ( ) const
inline

Return this node's color.

Used exclusively for visualization.

References mColor.

◆ GetDepth()

virtual const int WsfAdvancedBehaviorTreeNode::GetDepth ( ) const
inlinevirtual

Get the depth of this node.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeLeafNode.

◆ GetDescription()

const std::string & WsfAdvancedBehaviorTreeNode::GetDescription ( ) const
inline

Get the description of this node.

References mDescription.

◆ GetExecuteScript()

UtScript * WsfAdvancedBehaviorTreeNode::GetExecuteScript ( )
inline

Return a pointer to the execute script for this node.

References mExecuteScriptPtr.

◆ GetExecuteTooltip()

const std::string & WsfAdvancedBehaviorTreeNode::GetExecuteTooltip ( ) const
inline

Return the current execute tooltip text for this node.

References mExecuteTooltip.

◆ GetFileLastModTime()

const time_t & WsfAdvancedBehaviorTreeNode::GetFileLastModTime ( ) const
inline

Return the last time the script this node was declared in was modified.

References mFileLastModTime.

◆ GetFilePath()

const std::string & WsfAdvancedBehaviorTreeNode::GetFilePath ( ) const
inline

Return the file path to the script this node was declared in.

References mFullPathFileName.

◆ GetIsTreeRootNode()

bool WsfAdvancedBehaviorTreeNode::GetIsTreeRootNode ( ) const
inline

Get if this tree is a root node for a tree.

References mIsTreeRootNode.

◆ GetNodeName()

const std::string & WsfAdvancedBehaviorTreeNode::GetNodeName ( ) const
inline

Get the name of this node.

References mName.

◆ GetNodeStatus()

const BT::ReturnStatus & WsfAdvancedBehaviorTreeNode::GetNodeStatus ( ) const
inline

Get the ReturnStatus of this node.

References mReturnStatus.

Referenced by WsfAdvancedBehaviorTreeActionNode::Tick(), and WsfAdvancedBehaviorTreeRepeaterNode::TickFunction().

◆ GetOwningPlatform()

WsfPlatform * WsfAdvancedBehaviorTreeNode::GetOwningPlatform ( ) const

Return a pointer to the owning platform of this node.

References WsfAdvancedBehaviorTree::GetOwningPlatform(), and GetOwningTree().

Referenced by GetSimulation(), and Initialize().

◆ GetOwningProcessor()

WsfScriptProcessor * WsfAdvancedBehaviorTreeNode::GetOwningProcessor ( ) const

Return a pointer to the owning processor of this node.

References GetOwningTree(), and WsfAdvancedBehaviorTree::GetParentProcessor().

Referenced by Initialize().

◆ GetOwningTree()

WsfAdvancedBehaviorTree * WsfAdvancedBehaviorTreeNode::GetOwningTree ( ) const

Return a pointer to the owning tree of this node.

References mParentTreePtr.

Referenced by GetOwningPlatform(), GetOwningProcessor(), SetExecuteTooltip(), SetNodeStatus(), SetPreconditionTooltip(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetParent()

WsfAdvancedBehaviorTreeNode * WsfAdvancedBehaviorTreeNode::GetParent ( ) const
inline

Returns a pointer to the current parent of this node.

References mParentPtr, and WsfAdvancedBehaviorTreeNode().

Referenced by WsfAdvancedBehaviorTreeWeightedRandomNode::TickFunction().

◆ GetPreconditionTooltip()

const std::string & WsfAdvancedBehaviorTreeNode::GetPreconditionTooltip ( ) const
inline

Return the current precondition tooltip text for this node.

References mPreconditionTooltip.

◆ GetScenario()

const WsfScenario & WsfAdvancedBehaviorTreeNode::GetScenario ( ) const
inline

Return the current scenario.

References mScenario.

Referenced by WsfAdvancedBehaviorTreeLeafNode::ProcessInput().

◆ GetScriptAccessibleContext()

UtScriptContext * WsfAdvancedBehaviorTreeNode::GetScriptAccessibleContext ( ) const
overrideprotected

Return the context from the script.

References mContextPtr.

◆ GetScriptClassName()

const char * WsfAdvancedBehaviorTreeNode::GetScriptClassName ( ) const
override

Return the script class name for this node.

◆ GetScriptContext()

const WsfScriptContext & WsfAdvancedBehaviorTreeNode::GetScriptContext ( ) const
inline

Returns a reference to the script context for this node.

References mContextPtr.

Referenced by WsfAdvancedBehaviorTreeNode().

◆ GetSimulation()

◆ GetTopRootNode()

WsfAdvancedBehaviorTreeNode * WsfAdvancedBehaviorTreeNode::GetTopRootNode ( )

Get the top-most root node (ignore nodes considered as tree root nodes).

References WsfAdvancedBehaviorTreeNode().

Referenced by SetNodeStatus(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetTrees()

virtual std::map< size_t, ut::CloneablePtr< WsfAdvancedBehaviorTree > > & WsfAdvancedBehaviorTreeNode::GetTrees ( )
inlinevirtual

Return a list of current children trees held by this node.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode.

◆ GetTurnedOn()

◆ GetUniqueNodeId()

unsigned int WsfAdvancedBehaviorTreeNode::GetUniqueNodeId ( )
inlinestatic

Get a unique int id for this node.

Referenced by WsfAdvancedBehaviorTreeNode(), and WsfAdvancedBehaviorTreeNode().

◆ Halt()

virtual void WsfAdvancedBehaviorTreeNode::Halt ( const std::string & aReason)
inlinevirtual

◆ HaltChildren()

virtual void WsfAdvancedBehaviorTreeNode::HaltChildren ( unsigned int aIndex,
const std::string & aReason )
inlinevirtual

Halt the execution of this node's children starting at an index.

Helper function for Halt().

Parameters
aIndexindex to halt up to.
aReasonreason for halting.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode.

Referenced by Tick().

◆ HasChildrenContainer()

virtual const bool WsfAdvancedBehaviorTreeNode::HasChildrenContainer ( ) const
inlinevirtual

Get if this node can have children.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode.

Referenced by FindLastExecuted(), FindNode(), and Tick().

◆ HasDefinedColor()

bool WsfAdvancedBehaviorTreeNode::HasDefinedColor ( ) const
inline

Return the string representation of this node's color.

Used exclusively for visualization.

References mHasDefinedColor.

◆ HasParent()

const bool & WsfAdvancedBehaviorTreeNode::HasParent ( ) const
inline

Get if this node has a parent.

References mHasParent.

◆ Id()

const unsigned int & WsfAdvancedBehaviorTreeNode::Id ( ) const
inline

Return the unique id for this node.

References mId.

◆ Initialize()

bool WsfAdvancedBehaviorTreeNode::Initialize ( double aSimTime,
WsfScriptContext * aParentContextPtr )
virtual

Initializes this node.

Parameters
aSimTimetime to initialize the node.
aParentContextPtrscript context pointer that will populate data for the node.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode.

References BT::cDISABLED, GetOwningPlatform(), GetOwningProcessor(), mContextPtr, mFiniteStateMachinePtr, mInitialized, mMessageHandlerPtr, mOnInitScriptPtr, mReturnStatus, mStateIndex, mTurnedOn, and TurnOff().

Referenced by WsfAdvancedBehaviorTreeCompositeNode::Initialize().

◆ operator=()

WsfAdvancedBehaviorTreeNode & WsfAdvancedBehaviorTreeNode::operator= ( const WsfAdvancedBehaviorTreeNode & )
delete

◆ OutputTreeStates()

virtual void WsfAdvancedBehaviorTreeNode::OutputTreeStates ( const double aSimTime)
inlinevirtual

Output this nodes tree states to the event pipe if they are outputting.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeDecoratorNode.

◆ OutputTreeStructures()

virtual void WsfAdvancedBehaviorTreeNode::OutputTreeStructures ( const double aSimTime)
inlinevirtual

Output this nodes children trees structures to the event pipe.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeDecoratorNode.

◆ PreconditionsMet()

const bool WsfAdvancedBehaviorTreeNode::PreconditionsMet ( ) const

Returns a boolean representing if the precondition ran successfully or not.

References BT::cSUCCESS, mContextPtr, mInPrecondition, mPreconditionMet, mPreconditionRan, and mPreconditionScriptPtr.

Referenced by WsfAdvancedBehaviorTreeActionNode::Tick(), WsfAdvancedBehaviorTreeConditionNode::Tick(), and Tick().

◆ PreconditionValue()

virtual const double WsfAdvancedBehaviorTreeNode::PreconditionValue ( ) const
inlinevirtual

Returns a fitness value representing how well the precondition ran.

This will be used to determine which node has the highest priority to execute or which node has the highest weight.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, WsfAdvancedBehaviorTreeLeafNode, WsfAdvancedBehaviorTreeNegatorNode, WsfAdvancedBehaviorTreeParallelNode, WsfAdvancedBehaviorTreePrioritySelectorNode, WsfAdvancedBehaviorTreeSelectorNode, WsfAdvancedBehaviorTreeSelectorNodeWithMemory, and WsfAdvancedBehaviorTreeWeightedRandomNode.

◆ ProcessInput()

bool WsfAdvancedBehaviorTreeNode::ProcessInput ( UtInput & aInput)
overridevirtual

◆ ProcessMessage()

bool WsfAdvancedBehaviorTreeNode::ProcessMessage ( double aSimTime,
const WsfMessage & aMessage )
virtual

Process a script message.

Parameters
aSimTimesim time at time of processing.
aMessagemessage to process.

References mMessageHandlerPtr.

Referenced by WsfScriptProcessor::ProcessMessage().

◆ RegisterExternVariable()

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

Register an external variable.

Parameters
aVariableTypevariable type to register.
aVariableNamename of the variable.

References mContextPtr, and RegisterExternVariable().

Referenced by RegisterExternVariable(), and WsfAdvancedBehaviorTreeNode().

◆ RegisterInput()

virtual void WsfAdvancedBehaviorTreeNode::RegisterInput ( UtInput & aInput)
inlinevirtual

Register a file path and last modified time from an input.

Parameters
aInputinput to parse.

Reimplemented in WsfAdvancedBehaviorTreeLeafNode.

◆ Reset()

void WsfAdvancedBehaviorTreeNode::Reset ( )
inlinestatic

Reset the unique int counter.

◆ ResetPreconditionVars()

virtual void WsfAdvancedBehaviorTreeNode::ResetPreconditionVars ( )
inlinevirtual

Reset the precondition ran and met var to false at the beginning of the tree tick.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeLeafNode.

◆ SetDescription()

void WsfAdvancedBehaviorTreeNode::SetDescription ( const std::string & aDesc)
inline

Set the description of this node.

Parameters
aDescdescription to set

References mDescription.

◆ SetExecuteTooltip()

◆ SetFileInfo()

void WsfAdvancedBehaviorTreeNode::SetFileInfo ( const std::string & aPath,
const time_t & aModTime )
protected

Set the file path and last mod time for this node.

Parameters
aPathfile path to use.
aModTimelast modified time of the file.

References mFileLastModTime, and mFullPathFileName.

Referenced by SetFilePath().

◆ SetFilePath()

void WsfAdvancedBehaviorTreeNode::SetFilePath ( const std::string & aPath)

Set the file path for this node.

Parameters
aPathfile path to use.

References SetFileInfo().

Referenced by WsfAdvancedBehaviorTree::ProcessInput(), and WsfAdvancedBehaviorTreeLeafNode::RegisterInput().

◆ SetHasParent()

void WsfAdvancedBehaviorTreeNode::SetHasParent ( const bool aValue)

Set if this node has a parent.

Parameters
aValuevalue to set

References mHasParent.

◆ SetInitScript()

void WsfAdvancedBehaviorTreeNode::SetInitScript ( UtScript * aScriptPtr)

References mOnInitScriptPtr.

◆ SetIsTreeRootNode()

void WsfAdvancedBehaviorTreeNode::SetIsTreeRootNode ( const bool aState)
inline

Set if this node is the root node for a tree.

Parameters
aStatetrue to set the node as a root node, false otherwise.

References mIsTreeRootNode.

◆ SetNodeName()

void WsfAdvancedBehaviorTreeNode::SetNodeName ( const std::string & aName)

Set the name of this node.

Parameters
aNamename to set

References mName.

◆ SetNodeStatus()

◆ SetParent()

void WsfAdvancedBehaviorTreeNode::SetParent ( WsfAdvancedBehaviorTreeNode * aNodePtr)
inline

Set the parent of this node.

Parameters
aNodePtrnode to set as parent.

References mParentPtr, and WsfAdvancedBehaviorTreeNode().

◆ SetPreconditionTooltip()

◆ SetTooltip()

void WsfAdvancedBehaviorTreeNode::SetTooltip ( const std::string & aText,
const bool aSendEvent = false )

Set the tooltip text for this node.

Parameters
aTextreason for failure.
aSendEventshould we send an event when text is set?

References mInPrecondition, SetExecuteTooltip(), and SetPreconditionTooltip().

◆ SetTree()

virtual void WsfAdvancedBehaviorTreeNode::SetTree ( WsfAdvancedBehaviorTree * aTreePtr)
inlinevirtual

Set the owning tree for this node.

Parameters
aTreePtrthe tree that will own(parent) this node.

Reimplemented in WsfAdvancedBehaviorTreeActionNode, WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeLeafNode.

◆ Tick()

◆ TickFunction()

◆ TurnOff()

virtual void WsfAdvancedBehaviorTreeNode::TurnOff ( )
inlinevirtual

Turns this node off.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeLeafNode.

Referenced by Initialize(), and Tick().

◆ TurnOn()

virtual void WsfAdvancedBehaviorTreeNode::TurnOn ( )
inlinevirtual

Turns this node on.

Reimplemented in WsfAdvancedBehaviorTreeCompositeNode, and WsfAdvancedBehaviorTreeLeafNode.

Member Data Documentation

◆ mBlackboard

std::shared_ptr<WsfAttributeContainer> WsfAdvancedBehaviorTreeNode::mBlackboard
protected

◆ mColor

UtColor WsfAdvancedBehaviorTreeNode::mColor
protected

◆ mContextPtr

◆ mDebug

bool WsfAdvancedBehaviorTreeNode::mDebug {false}
protected

◆ mDescription

std::string WsfAdvancedBehaviorTreeNode::mDescription {""}
protected

◆ mExecutedLastTick

bool WsfAdvancedBehaviorTreeNode::mExecutedLastTick {false}
protected

◆ mExecuteScriptPtr

UtScript* WsfAdvancedBehaviorTreeNode::mExecuteScriptPtr {nullptr}
protected

◆ mExecuteTooltip

◆ mExecuteTooltipTimestamp

double WsfAdvancedBehaviorTreeNode::mExecuteTooltipTimestamp {-1.0}
protected

◆ mFileLastModTime

time_t WsfAdvancedBehaviorTreeNode::mFileLastModTime
protected

◆ mFiniteStateMachinePtr

◆ mFullPathFileName

std::string WsfAdvancedBehaviorTreeNode::mFullPathFileName {""}
protected

◆ mHasDefinedColor

bool WsfAdvancedBehaviorTreeNode::mHasDefinedColor
protected

◆ mHasParent

bool WsfAdvancedBehaviorTreeNode::mHasParent {false}
protected

◆ mId

unsigned int WsfAdvancedBehaviorTreeNode::mId {0}
protected

◆ mInitialized

bool WsfAdvancedBehaviorTreeNode::mInitialized {false}
protected

◆ mInPrecondition

bool WsfAdvancedBehaviorTreeNode::mInPrecondition {false}
mutableprotected

◆ mIsTreeRootNode

◆ mMessageHandlerPtr

◆ mName

std::string WsfAdvancedBehaviorTreeNode::mName {""}
protected

Referenced by GetNodeName(), SetNodeName(), WsfAdvancedBehaviorTreeInverterNode::WsfAdvancedBehaviorTreeInverterNode(), WsfAdvancedBehaviorTreeNegatorNode::WsfAdvancedBehaviorTreeNegatorNode(), WsfAdvancedBehaviorTreeNode(), WsfAdvancedBehaviorTreeNode(), WsfAdvancedBehaviorTreeParallelNode::WsfAdvancedBehaviorTreeParallelNode(), WsfAdvancedBehaviorTreeParallelNode::WsfAdvancedBehaviorTreeParallelNode(), WsfAdvancedBehaviorTreePrioritySelectorNode::WsfAdvancedBehaviorTreePrioritySelectorNode(), WsfAdvancedBehaviorTreePrioritySelectorNode::WsfAdvancedBehaviorTreePrioritySelectorNode(), WsfAdvancedBehaviorTreeRepeaterNode::WsfAdvancedBehaviorTreeRepeaterNode(), WsfAdvancedBehaviorTreeSelectorNode::WsfAdvancedBehaviorTreeSelectorNode(), WsfAdvancedBehaviorTreeSelectorNode::WsfAdvancedBehaviorTreeSelectorNode(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::WsfAdvancedBehaviorTreeSelectorNodeWithMemory(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::WsfAdvancedBehaviorTreeSelectorNodeWithMemory(), WsfAdvancedBehaviorTreeSequenceNode::WsfAdvancedBehaviorTreeSequenceNode(), WsfAdvancedBehaviorTreeSequenceNode::WsfAdvancedBehaviorTreeSequenceNode(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::WsfAdvancedBehaviorTreeSequenceNodeWithMemory(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::WsfAdvancedBehaviorTreeSequenceNodeWithMemory(), WsfAdvancedBehaviorTreeSucceederNode::WsfAdvancedBehaviorTreeSucceederNode(), WsfAdvancedBehaviorTreeWeightedRandomNode::WsfAdvancedBehaviorTreeWeightedRandomNode(), and WsfAdvancedBehaviorTreeWeightedRandomNode::WsfAdvancedBehaviorTreeWeightedRandomNode().

◆ mNewExecuteScriptPtr

UtScript* WsfAdvancedBehaviorTreeNode::mNewExecuteScriptPtr {nullptr}
protected

◆ mNewFailScriptPtr

UtScript* WsfAdvancedBehaviorTreeNode::mNewFailScriptPtr {nullptr}
protected

◆ mOnInitScriptPtr

UtScript* WsfAdvancedBehaviorTreeNode::mOnInitScriptPtr {nullptr}
protected

◆ mParentPtr

WsfAdvancedBehaviorTreeNode* WsfAdvancedBehaviorTreeNode::mParentPtr {nullptr}
protected

◆ mParentTreePtr

◆ mPreconditionMet

◆ mPreconditionRan

◆ mPreconditionScriptPtr

◆ mPreconditionTooltip

◆ mPreconditionTooltipTimestamp

double WsfAdvancedBehaviorTreeNode::mPreconditionTooltipTimestamp {-1.0}
protected

◆ mReturnStatus

◆ mScenario

const WsfScenario& WsfAdvancedBehaviorTreeNode::mScenario
protected

◆ mStateIndex

int WsfAdvancedBehaviorTreeNode::mStateIndex {0}
protected

◆ mTurnedOn


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