Qualia  0.2
Public Member Functions | Private Attributes | List of all members
BehaviorTree::ParallelNode Class Reference

Execute behaviors in parallel. More...

#include <ParallelNode.h>

Inheritance diagram for BehaviorTree::ParallelNode:
Inheritance graph
[legend]
Collaboration diagram for BehaviorTree::ParallelNode:
Collaboration graph
[legend]

Public Member Functions

BEHAVIOR_STATUS execute (void *agent)
 This method is invoked by the node's parent when the node should be run. More...
 
void init (void *agent)
 This method will be invoked before the node is executed for the first time. More...
 
 ParallelNode (FAILURE_POLICY failurePolicy=FAIL_ON_ALL, SUCCESS_POLICY successPolicy=SUCCEED_ON_ALL)
 
virtual ~ParallelNode ()
 
- Public Member Functions inherited from BehaviorTree::BehaviorTreeInternalNode
 BehaviorTreeInternalNode ()
 
virtual ~BehaviorTreeInternalNode ()
 
virtual BehaviorTreeNodesetChildren (BehaviorTreeNode *node,...)
 
virtual BehaviorTreeNode_setChildren (BehaviorTreeNode *node, va_list nodeList)
 Helper method for setChildren(). More...
 
- Public Member Functions inherited from BehaviorTree::BehaviorTreeNode
virtual ~BehaviorTreeNode ()
 

Private Attributes

bool * childrenRunning
 
FAILURE_POLICY failPolicy
 
SUCCESS_POLICY succeedPolicy
 
uint8_t nFailure
 
uint8_t nSuccess
 

Additional Inherited Members

- Public Attributes inherited from BehaviorTree::BehaviorTreeInternalNode
BehaviorTreeNode ** children
 This node's children nodes. More...
 
uint8_t nChildren
 The number of children of this node. More...
 

Detailed Description

Execute behaviors in parallel.

There are two policies that control the flow of execution. The first is the policy for failure, and the second is the policy for success.

For failure, the options are "fail when one child fails" and "fail when all children fail". For success, the options are similarly "complete when one child completes", and "complete when all children complete".

Constructor & Destructor Documentation

ParallelNode::ParallelNode ( FAILURE_POLICY  failurePolicy = FAIL_ON_ALL,
SUCCESS_POLICY  successPolicy = SUCCEED_ON_ALL 
)
Parameters
failurePolicyDetermines how many of the node's children must fail before the node fails
successPolicyDetermines how many of the node's children must succeed before the node succeeds
ParallelNode::~ParallelNode ( )
virtual

Member Function Documentation

BEHAVIOR_STATUS ParallelNode::execute ( void *  agent)
virtual

This method is invoked by the node's parent when the node should be run.

Implements BehaviorTree::BehaviorTreeInternalNode.

void ParallelNode::init ( void *  agent)
virtual

This method will be invoked before the node is executed for the first time.

Implements BehaviorTree::BehaviorTreeInternalNode.

Member Data Documentation

bool* BehaviorTree::ParallelNode::childrenRunning
private
FAILURE_POLICY BehaviorTree::ParallelNode::failPolicy
private
uint8_t BehaviorTree::ParallelNode::nFailure
private
uint8_t BehaviorTree::ParallelNode::nSuccess
private
SUCCESS_POLICY BehaviorTree::ParallelNode::succeedPolicy
private

The documentation for this class was generated from the following files: