langgoap.TransitionModel

langgoap.TransitionModel#

class TransitionModel(*args, **kwargs)[source]#

Separates action specs from world dynamics.

Implementations expose two views:

  • expected() — deterministic point estimate, used by A*, CSP, and MCTS tree expansion. Must equal action.get_effects(state) unless divergence_policy opts out (see DivergencePolicy).

  • sample() — one draw from the effect distribution, used by MCTS rollouts and the graph action-executor. Free to diverge from expected() — that divergence is the whole point of a non-deterministic model.

The optional divergence_policy attribute declares intentional divergence between expected() and the action’s declared effects. Its absence (or None) means strict equality is enforced by assert_expected_matches_declared().

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

expected(state, action)

sample(state, action, rng)

Attributes

divergence_policy