|
WSF
|
#include <WsfAdvancedBehaviorTreeNode.hpp>


Public Member Functions | |
| WsfAdvancedBehaviorTreeLeafNode (const WsfScenario &aScenario) | |
| WsfAdvancedBehaviorTreeLeafNode (const WsfAdvancedBehaviorTreeLeafNode &aSrc) | |
| WsfAdvancedBehaviorTreeLeafNode & | operator= (const WsfAdvancedBehaviorTreeLeafNode &aRhs)=delete |
| WsfAdvancedBehaviorTreeLeafNode * | Clone () const override |
| Clone this node. | |
| const int | GetDepth () const override |
| Return the depth of this node. | |
| void | Halt (const std::string &aReason) override |
| Halt the execution of this node. | |
| const double | PreconditionValue () const override |
| Returns a fitness value representing how well the precondition ran. | |
| bool | ProcessInput (UtInput &aInput) override |
| Process input from a script. | |
| void | RegisterInput (UtInput &aInput) override |
| Register a file path and last modified time from an input. | |
| void | TurnOff () override |
| Turns this node off. | |
| void | TurnOn () override |
| Turns this node on. | |
| void | ResetPreconditionVars () override |
| Reset the precondition ran and met var to false at the beginning of the tree tick. | |
| Public Member Functions inherited from WsfAdvancedBehaviorTreeNode | |
| WsfAdvancedBehaviorTreeNode (const WsfScenario &aScenario) | |
| WsfAdvancedBehaviorTreeNode (const WsfAdvancedBehaviorTreeNode &aSrc) | |
| ~WsfAdvancedBehaviorTreeNode () override | |
| WsfAdvancedBehaviorTreeNode & | operator= (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. | |
| 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< WsfAttributeContainer > | GetBlackboard () |
| 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::ReturnStatus & | GetNodeStatus () const |
| Get the ReturnStatus of this node. | |
| const WsfScenario & | GetScenario () const |
| Return the current scenario. | |
| const char * | GetScriptClassName () const override |
| Return the script class name for this node. | |
| const WsfScriptContext & | GetScriptContext () const |
| Returns a reference to the script context for this node. | |
| WsfSimulation * | GetSimulation () 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 | 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. | |
| WsfPlatform * | GetOwningPlatform () const |
| Return a pointer to the owning platform of this node. | |
| WsfScriptProcessor * | GetOwningProcessor () const |
| Return a pointer to the owning processor of this node. | |
| WsfAdvancedBehaviorTree * | GetOwningTree () const |
| Return a pointer to the owning tree of this node. | |
| WsfAdvancedBehaviorTreeNode * | GetParent () 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. | |
| bool | ProcessInput (UtInput &aInput) override |
| Process input from a script. | |
| virtual bool | ProcessMessage (double aSimTime, const WsfMessage &aMessage) |
| Process a script message. | |
| 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 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. | |
| bool | ExecutedLastTick () const |
| WsfAdvancedBehaviorTreeNode * | FindNode (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. | |
| WsfScriptStateMachine * | ChildStateMachine () |
| WsfAdvancedBehaviorTreeNode * | GetTopRootNode () |
| 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 TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (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 | |
| void | SetTree (WsfAdvancedBehaviorTree *aTreePtr) override |
| Set the owning tree for this node. | |
| Protected Member Functions inherited from WsfAdvancedBehaviorTreeNode | |
| 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()). | |
Additional Inherited Members | |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
| Static Public Member Functions inherited from WsfAdvancedBehaviorTreeNode | |
| static unsigned int | GetUniqueNodeId () |
| Get a unique int id for this node. | |
| static void | Reset () |
| Reset the unique int counter. | |
| Protected Attributes inherited from WsfAdvancedBehaviorTreeNode | |
| unsigned int | mId {0} |
| const WsfScenario & | mScenario |
| std::shared_ptr< WsfAttributeContainer > | mBlackboard |
| WsfScriptContext * | mContextPtr {nullptr} |
| WsfScriptMessageHandler * | mMessageHandlerPtr {nullptr} |
| WsfAdvancedBehaviorTreeNode * | mParentPtr {nullptr} |
| WsfAdvancedBehaviorTree * | mParentTreePtr {nullptr} |
| WsfScriptStateMachine * | mFiniteStateMachinePtr {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 |
| WsfAdvancedBehaviorTreeLeafNode::WsfAdvancedBehaviorTreeLeafNode | ( | const WsfScenario & | aScenario | ) |
References WsfObject::SetName(), WsfObject::SetType(), and WsfAdvancedBehaviorTreeNode::WsfAdvancedBehaviorTreeNode().
Referenced by Clone(), operator=(), WsfAdvancedBehaviorTreeActionNode::WsfAdvancedBehaviorTreeActionNode(), WsfAdvancedBehaviorTreeConditionNode::WsfAdvancedBehaviorTreeConditionNode(), and WsfAdvancedBehaviorTreeLeafNode().
| WsfAdvancedBehaviorTreeLeafNode::WsfAdvancedBehaviorTreeLeafNode | ( | const WsfAdvancedBehaviorTreeLeafNode & | aSrc | ) |
|
overridevirtual |
Clone this node.
Implements WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeLeafNode().
|
inlineoverridevirtual |
Return the depth of this node.
Leaf nodes have no children, so depth will always be 0.
Reimplemented from WsfAdvancedBehaviorTreeNode.
|
overridevirtual |
Halt the execution of this node.
| aReason | reason for halting. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References BT::cHALTED, WsfAdvancedBehaviorTreeNode::SetExecuteTooltip(), WsfAdvancedBehaviorTreeNode::SetNodeStatus(), and WsfAdvancedBehaviorTreeNode::SetPreconditionTooltip().
Referenced by WsfAdvancedBehaviorTreeActionNode::Halt(), and WsfAdvancedBehaviorTreeConditionNode::Halt().
|
delete |
References WsfAdvancedBehaviorTreeLeafNode().
|
overridevirtual |
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 from WsfAdvancedBehaviorTreeNode.
References BT::cSUCCESS, WsfAdvancedBehaviorTreeNode::mContextPtr, WsfAdvancedBehaviorTreeNode::mPreconditionMet, WsfAdvancedBehaviorTreeNode::mPreconditionRan, and WsfAdvancedBehaviorTreeNode::mPreconditionScriptPtr.
|
overridevirtual |
Process input from a script.
| aInput | input to parse. |
Reimplemented from WsfObject.
References WsfAdvancedBehaviorTreeNode::GetScenario(), WsfAdvancedBehaviorTreeNode::mParentTreePtr, WsfAdvancedBehaviorTreeNode::ProcessInput(), and WsfObject::SetName().
Referenced by WsfScriptStateMachine::State::ProcessInput().
|
overridevirtual |
Register a file path and last modified time from an input.
| aInput | input to parse. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeNode::SetFilePath().
|
overridevirtual |
Reset the precondition ran and met var to false at the beginning of the tree tick.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeNode::mPreconditionMet, WsfAdvancedBehaviorTreeNode::mPreconditionRan, and WsfAdvancedBehaviorTreeNode::mPreconditionScriptPtr.
|
overrideprotectedvirtual |
Set the owning tree for this node.
| aTreePtr | the tree that will own(parent) this node. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeNode::mParentTreePtr.
|
overridevirtual |
Turns this node off.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References BT::cDISABLED, WsfAdvancedBehaviorTreeNode::mExecuteTooltip, WsfAdvancedBehaviorTreeNode::mPreconditionTooltip, WsfAdvancedBehaviorTreeNode::mTurnedOn, and WsfAdvancedBehaviorTreeNode::SetNodeStatus().
Referenced by WsfAdvancedBehaviorTreeActionNode::Tick(), and WsfAdvancedBehaviorTreeConditionNode::Tick().
|
overridevirtual |
Turns this node on.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References BT::cIDLE, WsfAdvancedBehaviorTreeNode::mExecuteTooltip, WsfAdvancedBehaviorTreeNode::mPreconditionTooltip, WsfAdvancedBehaviorTreeNode::mTurnedOn, and WsfAdvancedBehaviorTreeNode::SetNodeStatus().