|
WSF
|
#include <WsfAdvancedBehaviorTreeNode.hpp>


Public Member Functions | |
| WsfAdvancedBehaviorTreeCompositeNode (const WsfScenario &aScenario) | |
| WsfAdvancedBehaviorTreeCompositeNode (const WsfAdvancedBehaviorTreeCompositeNode &aSrc) | |
| ~WsfAdvancedBehaviorTreeCompositeNode () override=default | |
| WsfAdvancedBehaviorTreeCompositeNode & | operator= (const WsfAdvancedBehaviorTreeCompositeNode &)=delete |
| WsfAdvancedBehaviorTreeCompositeNode * | Clone () const override |
| Clone this node. | |
| void | AddChild (std::shared_ptr< WsfAdvancedBehaviorTreeNode > aChildPtr) override |
| Add a child to this node. | |
| void | AddTree (ut::CloneablePtr< WsfAdvancedBehaviorTree > &aTreePtr) override |
| Add a tree child to this node. | |
| std::vector< std::shared_ptr< WsfAdvancedBehaviorTreeNode > > & | GetChildren () override |
| Return a list of current children held by this node. | |
| std::map< size_t, ut::CloneablePtr< WsfAdvancedBehaviorTree > > & | GetTrees () override |
| Return a list of current children trees held by this node. | |
| void | OutputTreeStructures (const double aSimTime) override |
| Output this nodes children trees structures to the event pipe. | |
| void | OutputTreeStates (const double aSimTime) override |
| Output this nodes tree states to the event pipe if they are outputting. | |
| const int | GetDepth () const override |
| Get the depth of this node recursively through it's children. | |
| void | Halt (const std::string &aReason) override |
| Halt the execution of this node and it's children. | |
| const bool | HasChildrenContainer () const override |
| Get if this node can have children. | |
| bool | Initialize (double aSimTime, WsfScriptContext *aParentContextPtr) override |
| Initializes this node. | |
| const double | PreconditionValue () const override |
| Returns a fitness value representing how important this node is. | |
| void | SetTree (WsfAdvancedBehaviorTree *aTreePtr) override |
| Set the owning tree for this node. | |
| void | TurnOff () override |
| Turns this node off, and it's children recursively. | |
| void | TurnOn () override |
| Turns this node on, and it's children recursively. | |
| void | ResetPreconditionVars () override |
| Reset the precondition ran and met var to false at the beginning of the tree tick, recursing through all children nodes. | |
| Public Member Functions inherited from WsfAdvancedBehaviorTreeNode | |
| WsfAdvancedBehaviorTreeNode (const WsfScenario &aScenario) | |
| WsfAdvancedBehaviorTreeNode (const WsfAdvancedBehaviorTreeNode &aSrc) | |
| ~WsfAdvancedBehaviorTreeNode () override | |
| WsfAdvancedBehaviorTreeNode & | operator= (const WsfAdvancedBehaviorTreeNode &)=delete |
| 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. | |
| 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. | |
| 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. | |
| virtual void | RegisterInput (UtInput &aInput) |
| Register a file path and last modified time from an input. | |
| 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 | |
| const bool | AreChildrenRunning () const |
| Get if any children are running. | |
| const unsigned int | GetLastEnabledChild () const |
| Get the last(rightmost) enabled child in this node's children. | |
| const unsigned int | GetNumEnabledChildren () const |
| Get the number of enabled children. | |
| void | HaltChildren (unsigned int aIndex, const std::string &aReason) override |
| Halt the execution of this node's children starting at an index. | |
| void | HaltRunning (const std::string &aReason) |
| Halt the execution of this node's children that are running. | |
| 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. | |
| WsfAdvancedBehaviorTreeCompositeNode::WsfAdvancedBehaviorTreeCompositeNode | ( | const WsfScenario & | aScenario | ) |
References mChildren, mTrees, and WsfAdvancedBehaviorTreeNode::WsfAdvancedBehaviorTreeNode().
Referenced by Clone(), operator=(), WsfAdvancedBehaviorTreeCompositeNode(), WsfAdvancedBehaviorTreeDecoratorNode::WsfAdvancedBehaviorTreeDecoratorNode(), WsfAdvancedBehaviorTreeParallelNode::WsfAdvancedBehaviorTreeParallelNode(), WsfAdvancedBehaviorTreeParallelNode::WsfAdvancedBehaviorTreeParallelNode(), WsfAdvancedBehaviorTreeSelectorNode::WsfAdvancedBehaviorTreeSelectorNode(), WsfAdvancedBehaviorTreeSelectorNode::WsfAdvancedBehaviorTreeSelectorNode(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::WsfAdvancedBehaviorTreeSelectorNodeWithMemory(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::WsfAdvancedBehaviorTreeSelectorNodeWithMemory(), WsfAdvancedBehaviorTreeSequenceNode::WsfAdvancedBehaviorTreeSequenceNode(), WsfAdvancedBehaviorTreeSequenceNode::WsfAdvancedBehaviorTreeSequenceNode(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::WsfAdvancedBehaviorTreeSequenceNodeWithMemory(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::WsfAdvancedBehaviorTreeSequenceNodeWithMemory(), WsfAdvancedBehaviorTreeWeightedRandomNode::WsfAdvancedBehaviorTreeWeightedRandomNode(), and WsfAdvancedBehaviorTreeWeightedRandomNode::WsfAdvancedBehaviorTreeWeightedRandomNode().
| WsfAdvancedBehaviorTreeCompositeNode::WsfAdvancedBehaviorTreeCompositeNode | ( | const WsfAdvancedBehaviorTreeCompositeNode & | aSrc | ) |
|
overridedefault |
|
overridevirtual |
Add a child to this node.
| aChildPtr | child node to add. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeDecoratorNode.
References mChildren.
Referenced by AddTree(), and operator=().
|
overridevirtual |
Add a tree child to this node.
| aTreePtr | tree to add. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeDecoratorNode.
References AddChild(), mChildren, and mTrees.
Referenced by operator=().
|
protected |
Get if any children are running.
References BT::cRUNNING, and mChildren.
Referenced by WsfAdvancedBehaviorTreeParallelNode::TickFunction().
|
overridevirtual |
Clone this node.
Implements WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeDecoratorNode, WsfAdvancedBehaviorTreeInverterNode, WsfAdvancedBehaviorTreeNegatorNode, WsfAdvancedBehaviorTreeParallelNode, WsfAdvancedBehaviorTreePrioritySelectorNode, WsfAdvancedBehaviorTreeRepeaterNode, WsfAdvancedBehaviorTreeSelectorNode, WsfAdvancedBehaviorTreeSelectorNodeWithMemory, WsfAdvancedBehaviorTreeSequenceNode, WsfAdvancedBehaviorTreeSequenceNodeWithMemory, WsfAdvancedBehaviorTreeSucceederNode, and WsfAdvancedBehaviorTreeWeightedRandomNode.
References WsfAdvancedBehaviorTreeCompositeNode().
|
inlineoverridevirtual |
Return a list of current children held by this node.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References mChildren.
|
overridevirtual |
Get the depth of this node recursively through it's children.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References mChildren.
|
protected |
Get the last(rightmost) enabled child in this node's children.
References WsfAdvancedBehaviorTreeNode::GetTurnedOn(), and mChildren.
Referenced by WsfAdvancedBehaviorTreeSelectorNode::TickFunction(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::TickFunction(), WsfAdvancedBehaviorTreeSequenceNode::TickFunction(), and WsfAdvancedBehaviorTreeSequenceNodeWithMemory::TickFunction().
|
protected |
Get the number of enabled children.
References mChildren.
Referenced by WsfAdvancedBehaviorTreeParallelNode::TickFunction().
|
inlineoverridevirtual |
Return a list of current children trees held by this node.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References mTrees.
|
overridevirtual |
Halt the execution of this node and it's children.
| aReason | reason for halting. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeParallelNode, WsfAdvancedBehaviorTreeSelectorNodeWithMemory, and WsfAdvancedBehaviorTreeSequenceNodeWithMemory.
References BT::cHALTED, HaltChildren(), WsfAdvancedBehaviorTreeNode::SetExecuteTooltip(), WsfAdvancedBehaviorTreeNode::SetNodeStatus(), and WsfAdvancedBehaviorTreeNode::SetPreconditionTooltip().
Referenced by WsfAdvancedBehaviorTreeParallelNode::Halt(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::Halt(), and WsfAdvancedBehaviorTreeSequenceNodeWithMemory::Halt().
|
overrideprotectedvirtual |
Halt the execution of this node's children starting at an index.
Helper function for Halt().
| aIndex | index to halt up to. |
| aReason | reason for halting. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeNode::GetTurnedOn(), and mChildren.
Referenced by Halt(), WsfAdvancedBehaviorTreeDecoratorNode::TickFunction(), WsfAdvancedBehaviorTreeNegatorNode::TickFunction(), WsfAdvancedBehaviorTreePrioritySelectorNode::TickFunction(), WsfAdvancedBehaviorTreeSelectorNode::TickFunction(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::TickFunction(), WsfAdvancedBehaviorTreeSequenceNode::TickFunction(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::TickFunction(), WsfAdvancedBehaviorTreeSucceederNode::TickFunction(), and WsfAdvancedBehaviorTreeWeightedRandomNode::TickFunction().
|
protected |
Halt the execution of this node's children that are running.
| aReason | reason for halting. |
References BT::cRUNNING, and mChildren.
|
inlineoverridevirtual |
Get if this node can have children.
Reimplemented from WsfAdvancedBehaviorTreeNode.
|
overridevirtual |
Initializes this node.
| aSimTime | time to initialize the node. |
| aParentContextPtr | script context pointer that will populate data for the node. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References WsfAdvancedBehaviorTreeNode::Initialize(), mChildren, WsfAdvancedBehaviorTreeNode::mContextPtr, and WsfAdvancedBehaviorTreeNode::mInitialized.
|
delete |
References AddChild(), AddTree(), and WsfAdvancedBehaviorTreeCompositeNode().
|
overridevirtual |
Output this nodes tree states to the event pipe if they are outputting.
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeDecoratorNode.
References mChildren, WsfAdvancedBehaviorTreeNode::mIsTreeRootNode, and WsfAdvancedBehaviorTreeNode::mParentTreePtr.
|
overridevirtual |
Output this nodes children trees structures to the event pipe.
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeDecoratorNode.
|
overridevirtual |
Returns a fitness value representing how important this node is.
For a composite node, by default this returns the first child's weight. Sequence and most decorators will use this.
Reimplemented from WsfAdvancedBehaviorTreeNode.
Reimplemented in WsfAdvancedBehaviorTreeNegatorNode, WsfAdvancedBehaviorTreeParallelNode, WsfAdvancedBehaviorTreePrioritySelectorNode, WsfAdvancedBehaviorTreeSelectorNode, WsfAdvancedBehaviorTreeSelectorNodeWithMemory, and WsfAdvancedBehaviorTreeWeightedRandomNode.
References mChildren.
|
overridevirtual |
Reset the precondition ran and met var to false at the beginning of the tree tick, recursing through all children nodes.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References mChildren, WsfAdvancedBehaviorTreeNode::mPreconditionMet, WsfAdvancedBehaviorTreeNode::mPreconditionRan, and WsfAdvancedBehaviorTreeNode::mPreconditionScriptPtr.
|
overridevirtual |
Set the owning tree for this node.
| aTreePtr | the tree that will own(parent) this node. |
Reimplemented from WsfAdvancedBehaviorTreeNode.
References mChildren, and WsfAdvancedBehaviorTreeNode::mParentTreePtr.
|
overridevirtual |
Turns this node off, and it's children recursively.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References BT::cDISABLED, mChildren, WsfAdvancedBehaviorTreeNode::mExecuteTooltip, WsfAdvancedBehaviorTreeNode::mPreconditionTooltip, WsfAdvancedBehaviorTreeNode::mTurnedOn, and WsfAdvancedBehaviorTreeNode::SetNodeStatus().
Referenced by WsfAdvancedBehaviorTreeInverterNode::TickFunction(), WsfAdvancedBehaviorTreeNegatorNode::TickFunction(), WsfAdvancedBehaviorTreeRepeaterNode::TickFunction(), and WsfAdvancedBehaviorTreeSucceederNode::TickFunction().
|
overridevirtual |
Turns this node on, and it's children recursively.
Reimplemented from WsfAdvancedBehaviorTreeNode.
References BT::cIDLE, mChildren, WsfAdvancedBehaviorTreeNode::mExecuteTooltip, WsfAdvancedBehaviorTreeNode::mPreconditionTooltip, WsfAdvancedBehaviorTreeNode::mTurnedOn, and WsfAdvancedBehaviorTreeNode::SetNodeStatus().
|
protected |
Referenced by AddChild(), WsfAdvancedBehaviorTreeDecoratorNode::AddChild(), AddTree(), AreChildrenRunning(), GetChildren(), GetDepth(), GetLastEnabledChild(), GetNumEnabledChildren(), HaltChildren(), HaltRunning(), Initialize(), OutputTreeStates(), WsfAdvancedBehaviorTreeDecoratorNode::OutputTreeStates(), OutputTreeStructures(), WsfAdvancedBehaviorTreeDecoratorNode::OutputTreeStructures(), PreconditionValue(), WsfAdvancedBehaviorTreeParallelNode::PreconditionValue(), WsfAdvancedBehaviorTreePrioritySelectorNode::PreconditionValue(), WsfAdvancedBehaviorTreeSelectorNode::PreconditionValue(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::PreconditionValue(), ResetPreconditionVars(), SetTree(), WsfAdvancedBehaviorTreeDecoratorNode::TickFunction(), WsfAdvancedBehaviorTreeInverterNode::TickFunction(), WsfAdvancedBehaviorTreeNegatorNode::TickFunction(), WsfAdvancedBehaviorTreeParallelNode::TickFunction(), WsfAdvancedBehaviorTreePrioritySelectorNode::TickFunction(), WsfAdvancedBehaviorTreeRepeaterNode::TickFunction(), WsfAdvancedBehaviorTreeSelectorNode::TickFunction(), WsfAdvancedBehaviorTreeSelectorNodeWithMemory::TickFunction(), WsfAdvancedBehaviorTreeSequenceNode::TickFunction(), WsfAdvancedBehaviorTreeSequenceNodeWithMemory::TickFunction(), WsfAdvancedBehaviorTreeSucceederNode::TickFunction(), WsfAdvancedBehaviorTreeWeightedRandomNode::TickFunction(), TurnOff(), TurnOn(), WsfAdvancedBehaviorTreeCompositeNode(), and WsfAdvancedBehaviorTreeCompositeNode().
|
protected |