Represents a single node in the Monte Carlo Search Tree.
More...
#include <MCTS.h>
|
| | MCTSNode ()=default |
| | MCTSNode (Move m, MCTSNode *p) |
| float | ucb (float explorationConstant) const |
| | Calculates the Upper Confidence Bound (UCB1) for this node.
|
| float | meanValue () const |
| | Calculates the mean expected value of the node.
|
|
| Move | move |
| | Move that led to this node.
|
| MCTSNode * | parent = nullptr |
| | Pointer to the parent node.
|
| std::vector< std::unique_ptr< MCTSNode > > | children |
| | Child nodes.
|
| int | visits = 0 |
| | Number of times this node has been visited.
|
| float | valueSum = 0.0f |
| | Cumulative value from all rollouts/evaluations passing through this node.
|
| bool | expanded = false |
| | True if the node's children have been generated.
|
Represents a single node in the Monte Carlo Search Tree.
◆ MCTSNode() [1/2]
◆ MCTSNode() [2/2]
◆ meanValue()
| float MCTSNode::meanValue |
( |
| ) |
const |
|
inline |
Calculates the mean expected value of the node.
- Returns
- The average value score.
◆ ucb()
| float MCTSNode::ucb |
( |
float | explorationConstant | ) |
const |
|
inline |
Calculates the Upper Confidence Bound (UCB1) for this node.
- Parameters
-
| explorationConstant | The exploration weight (e.g., sqrt(2)). |
- Returns
- The UCB score used for selection.
◆ children
| std::vector<std::unique_ptr<MCTSNode> > MCTSNode::children |
◆ expanded
| bool MCTSNode::expanded = false |
True if the node's children have been generated.
◆ move
Move that led to this node.
◆ parent
Pointer to the parent node.
◆ valueSum
| float MCTSNode::valueSum = 0.0f |
Cumulative value from all rollouts/evaluations passing through this node.
◆ visits
Number of times this node has been visited.
The documentation for this struct was generated from the following file: