libmcts
A Monte Carlo Tree Search Library
Public Member Functions | List of all members
mcts::IBackpropagationStrategy Class Referenceabstract

A backpropagation strategy is used in each node. when a terminal node is simulated, its value is propagated back through every node on the path. every node saves that value according to the implementation of a specific on_backpropagate function. More...

#include <ibackpropagation_strategy.hpp>

Inheritance diagram for mcts::IBackpropagationStrategy:
mcts::AvgBackpropagationStrategy

Public Member Functions

virtual void on_backpropagate (const double &value)=0
 saves an value according to some metric. More...
 
virtual double ev () const =0
 gets the current expected value More...
 
virtual double std_deviation () const =0
 gets the current standard deviation More...
 
virtual double variance () const =0
 gets the current variance More...
 
virtual int nb_samples () const =0
 gets the number of samples that are saved in the strat. More...
 
virtual IBackpropagationStrategycreate ()=0
 creates a new object of the same type and with the same constructor as the current object. More...
 

Detailed Description

A backpropagation strategy is used in each node. when a terminal node is simulated, its value is propagated back through every node on the path. every node saves that value according to the implementation of a specific on_backpropagate function.

Definition at line 13 of file ibackpropagation_strategy.hpp.

Member Function Documentation

◆ create()

virtual IBackpropagationStrategy* mcts::IBackpropagationStrategy::create ( )
pure virtual

creates a new object of the same type and with the same constructor as the current object.

Returns
pointer to a new backprop strat.

Implemented in mcts::AvgBackpropagationStrategy.

◆ ev()

virtual double mcts::IBackpropagationStrategy::ev ( ) const
pure virtual

gets the current expected value

Returns
current ev

Implemented in mcts::AvgBackpropagationStrategy.

Referenced by mcts::InnerNode< Context, Config >::ev().

◆ nb_samples()

virtual int mcts::IBackpropagationStrategy::nb_samples ( ) const
pure virtual

gets the number of samples that are saved in the strat.

Returns
count of backpropagated values

Implemented in mcts::AvgBackpropagationStrategy.

Referenced by mcts::InnerNode< Context, Config >::nb_samples().

◆ on_backpropagate()

virtual void mcts::IBackpropagationStrategy::on_backpropagate ( const double &  value)
pure virtual

saves an value according to some metric.

Parameters
valueto store

Implemented in mcts::AvgBackpropagationStrategy.

Referenced by mcts::InnerNode< Context, Config >::backpropagate().

◆ std_deviation()

virtual double mcts::IBackpropagationStrategy::std_deviation ( ) const
pure virtual

gets the current standard deviation

Returns
current std dev

Implemented in mcts::AvgBackpropagationStrategy.

Referenced by mcts::InnerNode< Context, Config >::std_dev().

◆ variance()

virtual double mcts::IBackpropagationStrategy::variance ( ) const
pure virtual

gets the current variance

Returns
current var

Implemented in mcts::AvgBackpropagationStrategy.

Referenced by mcts::InnerNode< Context, Config >::variance().


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