TimeTriggeredPlan

class unified_planning.plans.TimeTriggeredPlan(actions: List[Tuple[Fraction, ActionInstance, Fraction | None]], environment: Environment | None = None)[source]

Bases: Plan

Represents a time triggered plan.

property timed_actions: List[Tuple[Fraction, ActionInstance, Fraction | None]]

Returns the sequence of tuples (start, action_instance, duration) where:

  • start is when the ActionInstance starts;

  • action_instance is the grounded Action applied;

  • duration is the (optional) duration of the ActionInstance.

replace_action_instances(replace_function: Callable[[ActionInstance], ActionInstance | None]) Plan[source]

Returns a new TimeTriggeredPlan where every ActionInstance of the current Plan is replaced using the given replace_function.

Parameters:

replace_function – The function that applied to an ActionInstance A returns the ActionInstance B; B replaces A in the resulting Plan.

Returns:

The TimeTriggeredPlan where every ActionInstance is replaced using the given replace_function.

convert_to(plan_kind: PlanKind, problem: AbstractProblem) Plan[source]

This function takes a PlanKind and returns the representation of self in the given plan_kind. If the conversion does not make sense, raises an exception.

Parameters:
  • plan_kind – The plan_kind of the returned plan.

  • problem – The Problem of which this plan is referring to.

Returns:

The plan equivalent to self but represented in the kind of plan_kind.

extract_epsilon(problem: Problem) Fraction | None[source]

Returns the epsilon of this plan. The epsilon is the minimum time that elapses between 2 events of this plan.

Parameters:

problem – The problem referred by this plan.

Returns:

The minimum time elapses between 2 events of this plan. None is returned if the plan does not have at least 2 events.

property environment: Environment

Return this plan’s Environment.

property kind: PlanKind

Returns the Plan kind