Qualia
0.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
qualia
plugins
bt
ProbabilityNode.h
Go to the documentation of this file.
1
#include "
mtrand.h
"
2
3
namespace
BehaviorTree
4
{
5
9
struct
WeightedBehaviorTreeNode
{
10
float
weight
;
11
BehaviorTreeNode
*
node
;
12
13
WeightedBehaviorTreeNode
(
float
weight_,
BehaviorTreeNode
* node_) :
weight
(weight_),
node
(node_) {}
14
15
bool
isNull
()
const
{
return
(
node
== NULL); }
16
18
static
const
WeightedBehaviorTreeNode
NULL_WEIGHTED_NODE
;
19
};
20
22
27
class
ProbabilityNode
:
public
BehaviorTreeInternalNode
28
{
29
public
:
30
ProbabilityNode
();
31
virtual
~ProbabilityNode
();
32
34
virtual
BehaviorTreeNode
*
setChildren
(
BehaviorTreeNode
* node, ...);
35
40
virtual
BehaviorTreeNode
*
setWeightedChildren
(
WeightedBehaviorTreeNode
weightedNode, ...);
41
46
#if is_computer()
47
virtual
ProbabilityNode
* addChild(
BehaviorTreeNode
* node,
float
weight);
48
#endif
49
50
void
init
(
void
*
object
);
51
BEHAVIOR_STATUS
execute
(
void
*
object
);
52
53
private
:
54
MTRand_closed
random
;
55
float
totalSum
;
56
BehaviorTreeNode
*
currentNode
;
57
float
*
weighting
;
58
};
59
60
}
Generated on Fri Oct 11 2013 19:01:21 for Qualia by
1.8.3.1