Timing

class unified_planning.model.timing.Timing(delay: int | float | Fraction | str, timepoint: Timepoint)[source]

Bases: object

Time defined relatively to a Timepoint.

Class that used a Timepoint to define from when this Timing is considered and a delay, representing the distance from the given Timepoint. For instance: A GLOBAL_START Timepoint with a delay of 5 means 5 units of time after the initial state.

property delay: int | Fraction

Returns the delay set for this Timing from the timepoint.

property timepoint: Timepoint

Returns the Timepoint from which this Timing is considered.

is_global() bool[source]

Returns True if this Timing refers to the global timing in the Plan and not the start/end of an Action, False otherwise.

is_from_start() bool[source]

Returns True if this Timing is from the start, False if it is from the end.

is_from_end() bool[source]

Returns True if this Timing is from the end, False if it is from the start.

static from_time(time: up.model.timing.Timing | up.model.timing.Timepoint | int | float | Fraction) Timing[source]

Converts any supported time expression into its canonical Timing representation.