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.
unit of time to count. Does not need to be a round unit (i.e. can be 1.5 minutes, if you want).
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.
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 spantrue
(vacuously) outside the union of all A spansfalse
inside any A spans that do not contain a B spanThe 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.
child spans to check the existence of.
Optional
requirement: SpansContainsRequirementwhat to check for in each parent span.
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.
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.
UnsplittableIntervalException during backend evaluation if the duration of a span is fewer microseconds than N.
how many sub-spans to split each span into
Inclusivity for any newly generated span start points (default Inclusive).
Inclusivity for any newly generated span end points (default Exclusive).
Static
ForCheck a constraint for each instance of an activity type.
activity type to check
Optional
expression: ((instance: ActivityInstance<A>) => Spans)function of an activity instance that returns a Constraint; default returns the instance's span.
Static
FromGenerated using TypeDoc
A set of intervals that can overlap without being coaleseced together.