libmcts
A Monte Carlo Tree Search Library
Public Member Functions | Protected Attributes | List of all members
mcts::SamplingToFunctionSelector< Context, Config > Class Template Reference

Uses sampling selector until threshold is reached. After that a supplied selection strategy is applied. More...

#include <sampling_to_function_selector.hpp>

Inheritance diagram for mcts::SamplingToFunctionSelector< Context, Config >:
mcts::ISelectionStrategy< Context, Config >

Public Member Functions

 SamplingToFunctionSelector (int threshold_, sstrategy_t *function_strat_)
 create new selector More...
 
node_tselect (node_t *node)
 select a child of node More...
 

Protected Attributes

int threshold
 number of samples before the strategy is switched.
 
sstrategy_tfunction_strat
 
sampling_selector_t sselector
 

Additional Inherited Members

- Public Types inherited from mcts::ISelectionStrategy< Context, Config >
typedef ISelectionStrategy< Context, Config > sstrategy_t
 

Detailed Description

template<typename Context, typename Config>
class mcts::SamplingToFunctionSelector< Context, Config >

Uses sampling selector until threshold is reached. After that a supplied selection strategy is applied.

Template Parameters
Context@README
Config@README

Definition at line 16 of file sampling_to_function_selector.hpp.

Constructor & Destructor Documentation

◆ SamplingToFunctionSelector()

template<typename Context , typename Config >
mcts::SamplingToFunctionSelector< Context, Config >::SamplingToFunctionSelector ( int  threshold_,
sstrategy_t function_strat_ 
)
inline

create new selector

Parameters
threshold_number of samples that must have run through the node before strategies are switched.
function_strat_pointer to selection strategy to switch to.

Definition at line 29 of file sampling_to_function_selector.hpp.

30  : threshold(threshold_), function_strat(function_strat_),
31  sselector(sampling_selector_t()) {}
int threshold
number of samples before the strategy is switched.

Member Function Documentation

◆ select()

template<typename Context , typename Config >
node_t* mcts::SamplingToFunctionSelector< Context, Config >::select ( node_t node)
inlinevirtual

select a child of node

Parameters
nodeto select child from
Returns
pointer to childnode of node

Implements mcts::ISelectionStrategy< Context, Config >.

Definition at line 33 of file sampling_to_function_selector.hpp.

33  {
34  return (node->nb_samples() < threshold) ? sselector.select(node)
35  : function_strat->select(node);
36  }
node_t * select(node_t *node)
randomly chooses a child of node
int threshold
number of samples before the strategy is switched.
virtual node_t * select(node_t *node)=0
select a child of node

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