langgoap.MCTSStrategy

langgoap.MCTSStrategy#

class MCTSStrategy(exploration=<factory>, reuse=<factory>, tracing=<factory>, rollout_policy=None, transition_model=<factory>, scalar_heuristic=None)[source]#

Monte Carlo Tree Search planning strategy.

Implements the classical four-phase MCTS loop (selection, expansion, simulation, backpropagation) over GOAP action edges. Adapted from LATS’s select_node / expand_node / rollout / backpropagate quartet.

Configuration is grouped into three small dataclasses so callers only construct what they need to override:

Standalone fields are pluggable strategy components (rollout policy, transition model, scalar heuristic) rather than flags.

Parameters:
__init__(exploration=<factory>, reuse=<factory>, tracing=<factory>, rollout_policy=None, transition_model=<factory>, scalar_heuristic=None)#
Parameters:
Return type:

None

Methods

__init__([exploration, reuse, tracing, ...])

advance(action, observed_state)

Promote the subtree matching (action, observed_state) to the new carryover root with visit counts decayed by tree_reuse_decay.

aplan(start, goal, actions, *[, ...])

Async variant of plan() with parity on tracer hooks.

plan(start, goal, actions, *[, ...])

Attributes

exploration

reuse

tracing

rollout_policy

transition_model

scalar_heuristic