WSF
WsfBehaviorTree Class Reference

#include <WsfBehaviorTree.hpp>

Inheritance diagram for WsfBehaviorTree:
Collaboration diagram for WsfBehaviorTree:

Public Member Functions

 WsfBehaviorTree (const WsfScenario &aScenario)
 WsfBehaviorTree (const WsfBehaviorTree &aSrc)
WsfBehaviorTreeoperator= (const WsfBehaviorTree &aRhs)
WsfBehaviorTreeClone () const override
 ~WsfBehaviorTree () override
WsfBehaviorTreeNodeCreateNode (UtInput &aInput)
bool ProcessInput (UtInput &aInput) override
bool Execute (double simTime)
bool Initialize (double aSimTime, WsfScriptProcessor *aParentPtr, WsfScriptContext *aParentContextPtr=nullptr)
WsfBehaviorTreeParallelNodeRootNode () const
WsfScriptProcessorParentProcessor ()
WsfBehaviorTreeNodeFindNode (const std::string &aNodeName) const
void FindLastExecuted (std::vector< WsfBehaviorTreeNode * > &aLastExecuted) const
size_t NodeCount () const
WsfBehaviorTreeLeafNodeNodeEntry (size_t aIndex) const
void RegisterBehaviorNode (WsfBehaviorTreeLeafNode *aNodePtr)
WsfSimulationGetSimulation ()
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)

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Constructor & Destructor Documentation

◆ WsfBehaviorTree() [1/2]

WsfBehaviorTree::WsfBehaviorTree ( const WsfScenario & aScenario)

References WsfObject::WsfObject().

Referenced by Clone(), operator=(), and WsfBehaviorTree().

◆ WsfBehaviorTree() [2/2]

WsfBehaviorTree::WsfBehaviorTree ( const WsfBehaviorTree & aSrc)

◆ ~WsfBehaviorTree()

WsfBehaviorTree::~WsfBehaviorTree ( )
override

Member Function Documentation

◆ Clone()

WsfBehaviorTree * WsfBehaviorTree::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 WsfObject.

References WsfBehaviorTree().

Referenced by WsfScriptStateMachine::State::State(), and WsfScriptProcessor::WsfScriptProcessor().

◆ CreateNode()

◆ Execute()

bool WsfBehaviorTree::Execute ( double simTime)

References simTime.

◆ FindLastExecuted()

void WsfBehaviorTree::FindLastExecuted ( std::vector< WsfBehaviorTreeNode * > & aLastExecuted) const

Provides information on what the behavior tree is "currently" doing.

Parameters
aLastExecutedReturns the last nodes that were executed.

References WsfBehaviorTreeNode::FindLastExecuted().

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ FindNode()

WsfBehaviorTreeNode * WsfBehaviorTree::FindNode ( const std::string & aNodeName) const

◆ GetSimulation()

WsfSimulation * WsfBehaviorTree::GetSimulation ( )

◆ Initialize()

bool WsfBehaviorTree::Initialize ( double aSimTime,
WsfScriptProcessor * aParentPtr,
WsfScriptContext * aParentContextPtr = nullptr )

◆ NodeCount()

size_t WsfBehaviorTree::NodeCount ( ) const

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ NodeEntry()

WsfBehaviorTreeLeafNode * WsfBehaviorTree::NodeEntry ( size_t aIndex) const

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ operator=()

◆ ParentProcessor()

WsfScriptProcessor * WsfBehaviorTree::ParentProcessor ( )
inline

◆ ProcessInput()

bool WsfBehaviorTree::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 CreateNode(), and WsfBehaviorTreeNode::SetFilePath().

◆ RegisterBehaviorNode()

void WsfBehaviorTree::RegisterBehaviorNode ( WsfBehaviorTreeLeafNode * aNodePtr)

◆ RootNode()

WsfBehaviorTreeParallelNode * WsfBehaviorTree::RootNode ( ) const
inline

Referenced by UT_DEFINE_SCRIPT_METHOD().


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