SimulatedExecutionEnvironment

class unified_planning.model.contingent.SimulatedExecutionEnvironment(problem: ContingentProblem, max_constraints: int | None = None)[source]

Bases: ExecutionEnvironment

Simulates the effects of actions on a given contingent planning problem.

This class creates a deterministic version of a contingent problem by randomly resolving hidden fluent values (respecting oneof/or constraints), then uses a sequential simulator to apply actions and return observations.

Parameters:

problem – A ContingentProblem object representing the planning problem to simulate.

apply(action: ActionInstance) Dict[FNode, FNode][source]

Applies the given action to the current state and returns the resulting observation.

Parameters:

action – A ActionInstance object representing the action to apply.

Returns:

A dictionary mapping the fluent expressions observed by the sensing action to their corresponding values.

is_goal_reached() bool[source]

Determines whether the goal of the planning problem has been reached in the current state.

Returns:

A boolean value indicating whether the goal has been reached.