Skip to content

Commit

Permalink
add docs for schedule offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
geraintpalmer committed Apr 16, 2024
1 parent 63247d8 commit 63273ce
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/Guides/server_schedule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,37 @@ Simulating this system, we'll see that no services begin between dates 10 and 30



Schedule Offsets
----------------

A schedule can be offset by a given amount of time. This means that the cyclic schedule will have a delayed start, where no servers are present. This is defined using the :code:`offset` keyword. It's effect can be compared below::

ciw.Schedule(schedule=[[2, 10], [0, 30], [1, 100]])

gives:

+-------------------+---------+--------+--------+---------+---------+--------+
| Shift Times | 0-10 | 10-30 | 30-100 | 100-110 | 110-130 | ... |
+-------------------+---------+--------+--------+---------+---------+--------+
| Number of Servers | 2 | 0 | 1 | 2 | 0 | ... |
+-------------------+---------+--------+--------+---------+---------+--------+

whereas::

ciw.Schedule(schedule=[[2, 10], [0, 30], [1, 100]], offset=7.0)

gives:

+-------------------+---------+---------+--------+--------+---------+---------+--------+
| Shift Times | 0-7 | 7-17 | 17-37 | 37-107 | 107-117 | 117-137 | ... |
+-------------------+---------+---------+--------+--------+---------+---------+--------+
| Number of Servers | 0 | 2 | 0 | 1 | 2 | 0 | ... |
+-------------------+---------+---------+--------+--------+---------+---------+--------+


An offset of 7 here delays the beginning of the first shift by 7 time units, and that offset does not appear again in the cyclic schedule. The offset should only be defined as a positive float.


Pre-emption
-----------

Expand Down
32 changes: 32 additions & 0 deletions docs/Guides/slotted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ Simulating this system, we'll see that services only begin between during the sl
{1.5, 2.3, 2.8, 4.3, 5.1, 5.6}


Schedule Offsets
----------------

A slotted schedule can be offset by a given amount of time. This means that the cyclic schedule will have a delayed start. This is defined using the :code:`offset` keyword. It's effect can be compared below::

ciw.Slotted(slots=[1.5, 2.3, 2.8], slot_sizes=[2, 5, 3])

gives:

+----------------------------+------+------+------+------+------+------+------+------+
| Slot Times :math:`t` | 1.5 | 2.3 | 2.8 | 4.3 | 5.1 | 5.6 | 7.1 | ... |
+----------------------------+------+------+------+------+------+------+------+------+
| Slot Sizes :math:`s_t` | 2 | 5 | 3 | 2 | 5 | 3 | 2 | ... |
+----------------------------+------+------+------+------+------+------+------+------+

whereas::

ciw.Slotted(slots=[1.5, 2.3, 2.8], slot_sizes=[2, 5, 3], offset=10.0)

gives:

+----------------------------+-------+-------+-------+-------+-------+-------+-------+------+
| Slot Times :math:`t` | 11.5 | 12.3 | 12.8 | 14.3 | 15.1 | 15.6 | 17.1 | ... |
+----------------------------+-------+-------+-------+-------+-------+-------+-------+------+
| Slot Sizes :math:`s_t` | 2 | 5 | 3 | 2 | 5 | 3 | 2 | ... |
+----------------------------+-------+-------+-------+-------+-------+-------+-------+------+


An offset of 10 here delays the beginning of the first slot by 10 time units, and that offset does not appear again in the cyclic schedule. The offset should only be defined as a positive float.




Capacitated & Non-capacitated Slots
-----------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ th {

td {
font-size: 100%;
border: 1px solid #ddd !important;
}

0 comments on commit 63273ce

Please sign in to comment.