template<mcts_env_concept EnvTp, typename RolloutPolicy = UniformRolloutPolicy>
class bitrl::rl::algos::mc::MCTSSolver< EnvTp, RolloutPolicy >
Monte Carlo tree search, with UCB to pick the children (UCT).
MCTS plans from the state the environment is in. plan(env) grows a tree of action sequences from that state. Every simulation copies the environment and
- walks down the tree, always to the child with the largest upper confidence bound, until it reaches a node with a child it has not tried;
- adds that child, by taking its action;
- goes on with the actions of the rollout policy until the episode ends or the simulation is max_depth steps deep;
- adds to the score of every node on its path the reward of the step into the node and the discounted return that followed it. plan() then returns the action of the child of the root that was visited most. The environment the simulations run in can be a model of the world the agent acts in, as long as it is fast to copy and to step.
The rollout policy is called as policy(env, generator), with the environment of the simulation and the solver's random generator, and returns an action. Random actions, the default, need no knowledge of the problem; a policy that plays sensibly gives returns that say much more about the node the rollout starts from.