A list of time intervals during which a TaskResource is scheduled to be busy.
Each interval is represented as a pair of timestamps.
- Value Params
- tasks
Busy time intervals as pairs of timestamps.
- Example
Schedule(List( (1L,2L), (3L,4L) )) // The corresponding TaskResource is scheduled to be busy between
1L
and2L
and between3L
and4L
, and idle between0L
and1L
, between2L
and3L
and after4L
.- Companion
- object
Value members
Concrete methods
Adds another busy interval to the schedule.
Adds another busy interval to the schedule.
The new interval can only be added if it does not clash with any of the existing intervals.
Uses Schedule.add for the calculation.
- Value Params
- end
The end timestamp of the new interval.
- start
The start timestamp of the new interval.
- Returns
Some updated Schedule or scala.None upon failure.
- See also
- Example
Schedule(List((1L,2L), (6L,7L))) + (3,5) == Some(Schedule(List((1,2), (3,5), (6,7))))
Schedule(List((1L,3L), (6L,7L))) + (3,5) == Some(Schedule(List((1,5), (6,7))))
Schedule(List((1L,4L), (6L,7L))) + (3,5) == None
Merges the schedule with another one.
Merges the schedule with another one.
The merge involves adding all the busy intervals into a single schedule.
Uses Schedule.merge for the calculation.
- Value Params
- s
The other schedule to merge.
- Returns
The new merged schedule.
- See also
- Example
Schedule(List((1L,2L), (5L,6L))) ++ Schedule(List((3L,4L))) == Schedule(List((1,2), (3,4), (5,6))
Schedule(List((1L,2L), (3L,5L))) ++ Schedule(List((2L,4L))) == Schedule(List((1,5)))
Adds another busy interval to the schedule, if possible.
Adds another busy interval to the schedule, if possible.
The new interval can only be added if it does not clash with any of the existing intervals.
Uses Schedule.add for the calculation. Upon failure, returns the schedule unchanged.
- Value Params
- end
The end timestamp of the new interval.
- start
The start timestamp of the new interval.
- Returns
The updated schedule, or the same schedule if the update fails.
- See also
- Example
Schedule(List((1L,2L), (6L,7L))) +> (3,5) == Schedule(List((1,2), (3,5), (6,7)))
Schedule(List((1L,3L), (6L,7L))) +> (3,5) == Schedule(List((1,5), (6,7)))
Schedule(List((1L,4L), (6L,7L))) +> (3,5) == Schedule(List((1,4), (6,7)))
Adds the estimated interval of a TaskInstance to the schedule, if possible.
Adds the estimated interval of a TaskInstance to the schedule, if possible.
The new interval can only be added if it does not clash with any of the existing intervals.
Uses Schedule.add for the calculation. Upon failure, returns the schedule unchanged.
- Value Params
- startTime
The timestamp the TaskInstance started.
- t
The TaskInstance to be added.
- Returns
The updated schedule, or the same schedule if the update fails.
- See also
Finds the earliest possible start for a TaskInstance in the schedule.
Finds the earliest possible start for a TaskInstance in the schedule.
A TaskInstance fits into the schedule if the interval defined by the start time and the estimated duration of the TaskInstance has no overlap with any other interval in the schedule.
Uses Schedule.fit for the calculation.
- Value Params
- currentTime
The current (and thus earliest possible) time for the TaskInstance.
- t
The TaskInstance to be checked.
- Returns
The earliest possible start for the TaskInstance in this schedule.
- See also
Checks if this is a valid schedule.
Checks if this is a valid schedule.
A valid schedule contains valid, ordered intervals, that do not overlap. Valid intervals have a start that is earlier than their end.
Uses Schedule.isValid for the calculation.
- See also