A set of intervals that can overlap without being coaleseced together.

Hierarchy

  • Spans

Methods

  • Counts the cumulative amount of time spent in an active Span, as a multiple of some unit of time. Overlapping spans are double-counted.

    The output profile always starts at 0 at the simulation start time. Initial conditions from before the simulation start time are not considered, even in the case of temporal-subset plan branches with later start times.

    Parameters

    • unit: Duration

      unit of time to count. Does not need to be a round unit (i.e. can be 1.5 minutes, if you want).

    Returns Real

  • Connects the end of each of these spans to the start of the nearest span in the argument.

    This operation creates a new spans object. For each span s in this, it produces a span from the end of s to the start of the first span in other that occurs after the end of s.

    If s and the nearest subsequent span in other meet exactly, with no intersection and no space between them, a singleton span (containing exactly one time) is still created at the meeting point.

    If there are no spans in other that occur after s, a span is still created from the end of s until the end of the plan.

    Parameters

    Returns Spans

  • Creates a windows object that is false when one of these Spans does not contain a child span, and true otherwise. The parents are the callee and the children are the argument, i.e. parents.contains(children). The default requirement of one child per parent can be modified.

    More concretely, for the expression A.contains(B), the result is:

    • true inside any A spans if (by default) they contain at least one B span
      • for counting spans, "contain" means that the entire B span is inside the A span.
    • true (vacuously) outside the union of all A spans
    • false inside any A spans that do not contain a B span

    The requirement for one child span can be optionally changed by providing the second argument:

    • {count: n} requires exactly n children per parent.
    • {count: {min: n}} requires at least n children per parent.
    • {count: {max: n}} requires at most n children per parent
    • {duration: {min: d}} requires a total duration of children of at least d
    • {duration: {max: d}} requires a total duration of children of at most d

    Both count and duration can be provided at the same time (e.g. {count: 2, duration: {min: Temporal.Duration.from({hours: 1})}}). Both min and max can be provided at the same time (e.g. {count: {min: 1, max: 3}}.

    There is no option to require an exact duration, because the implementation uses floating point comparison. If you need an exact duration, you can approximate it by using a small range around the desired value.

    Parameters

    Returns Windows

  • Replaces each Span with its end point.

    Returns Spans

  • Selects only spans that occur during a true segment, removing those that don't.

    Spans that only partially overlap with a true segment will be truncated, and spans that overlap with multiple true segments will be split.

    Parameters

    Returns Spans

  • Shifts the start and end of each Span by a duration.

    Parameters

    • fromStart: Duration

      duration to shift start by

    • Optional fromEnd: Duration

      duration to shift end by (defaults is fromStart if omitted)

    Returns Spans

  • Splits each span into equal sized sub-spans.

    For .split(N), N sub-spans will be created by removing N-1 points in the middle.

    Throws

    UnsplittableIntervalException during backend evaluation if the duration of a span is fewer microseconds than N.

    Parameters

    • numberOfSubSpans: number

      how many sub-spans to split each span into

    • internalStartInclusivity: Inclusivity = Inclusivity.Inclusive

      Inclusivity for any newly generated span start points (default Inclusive).

    • internalEndInclusivity: Inclusivity = Inclusivity.Exclusive

      Inclusivity for any newly generated span end points (default Exclusive).

    Returns Spans

  • Replaces each Span with its start point.

    Returns Spans

  • Convert this into a set of Windows. Each span is a true segment, and everything else is false.

    This is a lossy operation. If any spans overlap or touch, they will be coalesced into a single window.

    Returns Windows

  • Check a constraint for each instance of an activity type.

    Type Parameters

    Parameters

    Returns Spans

  • Create a Spans object with a single span defined by an interval.

    Parameters

    • interval: Interval

      interval for the span

    Returns Spans

Generated using TypeDoc