Skip to content

Commit 8bdf419

Browse files
committed
Add proper documentation for ResourcePeriodicallyInterrupted
1 parent baf48ca commit 8bdf419

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

processscheduler/resource_constraint.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ class ResourcePeriodicallyInterrupted(ResourceConstraint):
378378
- list_of_time_intervals: A list of time intervals during which the resource is interrupting any task.
379379
For example, [(0, 2), (5, 8)] represents time intervals from 0 to 2 and from 5 to 8.
380380
- optional (bool, optional): Whether the constraint is optional (default is False).
381+
- period: The length of one period after which to repeat the list of time intervals.
382+
For example, setting this to 5 with [(2, 4)] gives unavailabilities at (2, 4), (7, 9), (12, 14), ...
383+
- start: The start after which repeating the list of time intervals is active (default is 0).
384+
- offset: The shift of the repeated list of time intervals (default is 0).
385+
It might be desired to set also the start parameter to the same value, as otherwise the pattern shifts in from the left or the right into the schedule.
386+
- end: The end until which repeating the list of time intervals is activate (default is None).
387+
- optional (bool, optional): Whether the constraint is optional (default is False).
381388
"""
382389

383390
resource: Union[Worker, CumulativeWorker]
@@ -395,6 +402,13 @@ def __init__(self, **data) -> None:
395402
:param list_of_time_intervals: A list of time intervals during which the resource is interrupting any task.
396403
For example, [(0, 2), (5, 8)] represents time intervals from 0 to 2 and from 5 to 8.
397404
:param optional: Whether the constraint is optional (default is False).
405+
:param period: The length of one period after which to repeat the list of time intervals.
406+
For example, setting this to 5 with [(2, 4)] gives unavailabilities at (2, 4), (7, 9), (12, 14), ...
407+
:param start: The start after which repeating the list of time intervals is active (default is 0).
408+
:param offset: The shift of the repeated list of time intervals (default is 0).
409+
It might be desired to set also the start parameter to the same value, as otherwise the pattern shifts in from the left or the right into the schedule.
410+
:param end: The end until which repeating the list of time intervals is activate (default is None).
411+
:param optional: Whether the constraint is optional (default is False).
398412
"""
399413
super().__init__(**data)
400414

@@ -491,7 +505,7 @@ def __init__(self, **data) -> None:
491505
task._duration <= task.max_duration + total_overlap
492506
)
493507

494-
508+
# TODO: add AND only of mask is set?
495509
core = z3.And(*conds)
496510

497511
mask = [core]

0 commit comments

Comments
 (0)