|
libmcts
A Monte Carlo Tree Search Library
|
basic interface for a node in the tree. Every node has to implement this functions. More...
#include <inode.hpp>
Public Types | |
| typedef INode< Context, Config > | node_t |
Public Member Functions | |
| virtual void | expand ()=0 |
| expand the current context and add all possible derived contexts as children. | |
| virtual node_t * | parent () const =0 |
| gets the parent of the current node More... | |
| virtual node_t * | select_child ()=0 |
| selects a childnode according to a configurable metric More... | |
| virtual node_t * | select_recusively ()=0 |
| recursively selects nodes with a given simulation strategy until an terminal node is reached. More... | |
| virtual Config * | config () const =0 |
| gets the config object More... | |
| virtual int | nb_samples () const =0 |
| number of times a selection strategy selected the current node. More... | |
| virtual const vector< node_t * > | children () const =0 |
| get the children of the current node More... | |
| virtual void | add_child (node_t *child)=0 |
| insert a new node as a child of the current one. More... | |
| virtual const Context | context () const =0 |
| gets the context associated with the current node More... | |
| 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 | accept (visitor_t *visitor)=0 |
| accepts a visitor according to the visitor pattern. 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... | |
basic interface for a node in the tree. Every node has to implement this functions.
| Context | @README |
| Config | @README |
|
pure virtual |
accepts a visitor according to the visitor pattern.
| visitor | object |
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
|
pure virtual |
insert a new node as a child of the current one.
| child | pointer to a node |
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
|
pure virtual |
applies a backpropagation strategy to traverse the simulated result back up in the tree.
| value |
Implemented in mcts::InnerNode< Context, Config >.
Referenced by mcts::InnerNode< Context, Config >::backpropagate(), and mcts::MCTS< Context, Config, WrapNode, ResultType >::iterate().
|
pure virtual |
get the children of the current node
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
Referenced by mcts::INode< Context, Config >::count_recursive(), mcts::MinFunctionSelector< Context, Config >::select(), mcts::MaxFunctionSelector< Context, Config >::select(), and mcts::SamplingSelector< Context, Config >::select().
|
pure virtual |
gets the config object
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
Referenced by mcts::MCTS< Context, Config, WrapNode, ResultType >::result(), and mcts::SamplingSelector< Context, Config >::select().
|
pure virtual |
gets the context associated with the current node
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
|
inlinevirtual |
recursively counts number of childen beneth this nodes. counts in the current node.
Definition at line 139 of file inode.hpp.
Referenced by mcts::MCTS< Context, Config, WrapNode, ResultType >::nb_nodes().
|
pure virtual |
gets the current expected value.
Implemented in mcts::InnerNode< Context, Config >.
Referenced by mcts::MaxValueSelector< Context, Config >::evaluate(), and mcts::UCTSelector< Context, Config >::evaluate().
|
pure virtual |
number of times a selection strategy selected the current node.
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
Referenced by mcts::MinSampleSelector< Context, Config >::evaluate(), mcts::UCTSelector< Context, Config >::evaluate(), and mcts::SamplingToFunctionSelector< Context, Config >::select().
|
pure virtual |
gets the parent of the current node
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
Referenced by mcts::UCTSelector< Context, Config >::evaluate().
|
pure virtual |
selects a childnode according to a configurable metric
Implemented in mcts::LeafNode< Context, Config >, and mcts::InnerNode< Context, Config >.
|
pure virtual |
recursively selects nodes with a given simulation strategy until an terminal node is reached.
Implemented in mcts::InnerNode< Context, Config >, and mcts::LeafNode< Context, Config >.
Referenced by mcts::MCTS< Context, Config, WrapNode, ResultType >::iterate(), and mcts::InnerNode< Context, Config >::select_recusively().
|
pure virtual |
applies a simulation strategy to a terminal node.
Implemented in mcts::InnerNode< Context, Config >.
Referenced by mcts::MCTS< Context, Config, WrapNode, ResultType >::iterate().
|
pure virtual |
|
pure virtual |
1.8.15