mcts.MCTSNode

class mcts.MCTSNode(interventions=None, parent=None)

Bases: object

Represents a node in the MCTS tree.

Each node corresponds to a state reached by applying a sequence of interventions from the root state.

Attributes:

interventions: Sequence of (object, action) tuples leading to this state. parent: Parent node in the tree, or None for root. children: List of child nodes. visits: Number of times this node has been visited. total_reward: Cumulative reward from all rollouts through this node. untried_actions: List of legal actions not yet expanded from this node. local_violations: Set of actions that led to violations (used for pruning).

__init__(interventions=None, parent=None)

Initialize a new MCTS node.

Args:

interventions: List of (object, action) tuples applied to reach this state. parent: Parent node in the tree, or None if this is the root.

Methods

__init__([interventions, parent])

Initialize a new MCTS node.