|
libmcts
A Monte Carlo Tree Search Library
|
implements methods of the inode interface that are used for terminal contexts. all leaf nodes are terminal. More...
#include <leaf_node.hpp>
Public Member Functions | |
| LeafNode (const Context &context, Config *config, node_t *parent) | |
| virtual void | expand () |
| expand the current context and add all possible derived contexts as children. | |
| virtual void | accept (visitor_t *visitor) |
| accepts a visitor according to the visitor pattern. More... | |
| virtual node_t * | parent () const |
| gets the parent of the current node More... | |
| virtual int | nb_samples () const |
| number of times a selection strategy selected the current node. More... | |
| virtual Config * | config () const |
| gets the config object More... | |
| virtual const Context | context () const |
| gets the context associated with the current node More... | |
| virtual const vector< node_t * > | children () const |
| get the children of the current node More... | |
| virtual void | add_child (node_t *child) |
| insert a new node as a child of the current one. More... | |
| virtual node_t * | select_recusively () |
| recursively selects nodes with a given simulation strategy until an terminal node is reached. More... | |
| virtual node_t * | select_child () |
| selects a childnode according to a configurable metric More... | |
Public Member Functions inherited from mcts::INode< Context, Config > | |
| virtual double | ev () const =0 |
| gets the current expected value. More... | |
| virtual double | std_dev () const =0 |
| gets the standard deviation. More... | |
| virtual double | variance () const =0 |
| gets the variance. More... | |
| virtual double | simulate () const =0 |
| applies a simulation strategy to a terminal node. More... | |
| virtual void | backpropagate (const double &value)=0 |
| applies a backpropagation strategy to traverse the simulated result back up in the tree. More... | |
| virtual unsigned | count_recursive () const |
| recursively counts number of childen beneth this nodes. counts in the current node. More... | |
Protected Attributes | |
| Context | context_ |
| Config * | config_ |
| node_t * | parent_ |
| int | nb_samples_ |
Additional Inherited Members | |
Public Types inherited from mcts::INode< Context, Config > | |
| typedef INode< Context, Config > | node_t |
implements methods of the inode interface that are used for terminal contexts. all leaf nodes are terminal.
| Context | @README |
| Config | @README |
Definition at line 16 of file leaf_node.hpp.
|
inlinevirtual |
accepts a visitor according to the visitor pattern.
| visitor | object |
Implements mcts::INode< Context, Config >.
Definition at line 28 of file leaf_node.hpp.
|
inlinevirtual |
insert a new node as a child of the current one.
| child | pointer to a node |
Implements mcts::INode< Context, Config >.
Definition at line 40 of file leaf_node.hpp.
|
inlinevirtual |
get the children of the current node
Implements mcts::INode< Context, Config >.
Definition at line 38 of file leaf_node.hpp.
|
inlinevirtual |
gets the config object
Implements mcts::INode< Context, Config >.
Definition at line 34 of file leaf_node.hpp.
|
inlinevirtual |
gets the context associated with the current node
Implements mcts::INode< Context, Config >.
Definition at line 36 of file leaf_node.hpp.
|
inlinevirtual |
number of times a selection strategy selected the current node.
Implements mcts::INode< Context, Config >.
Definition at line 32 of file leaf_node.hpp.
|
inlinevirtual |
gets the parent of the current node
Implements mcts::INode< Context, Config >.
Definition at line 30 of file leaf_node.hpp.
|
inlinevirtual |
selects a childnode according to a configurable metric
Implements mcts::INode< Context, Config >.
Definition at line 46 of file leaf_node.hpp.
|
inlinevirtual |
recursively selects nodes with a given simulation strategy until an terminal node is reached.
Implements mcts::INode< Context, Config >.
Definition at line 44 of file leaf_node.hpp.
1.8.15