Skip to content

Commit

Permalink
[#76] Add args unpacking to tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballs committed May 12, 2017
1 parent f6271a5 commit d1326e8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ event::
Workshop 1 at 16-Sep-2016 13:00 in Small
City tour at 16-Sep-2016 13:00 in Outside


We see that all the events are scheduled in appropriate rooms (as indicated by
the unavailability attribute for the events). Also we have that :code:`Talk 1`
doesn't clash with :code:`Workshop 1`.
Expand Down Expand Up @@ -178,11 +177,11 @@ Coping with new information
This is fantastic! Our schedule has now been published and everyone is excited
about the conference. However, as can often happen, one of the speakers now
informs us of a particular new constraints. For example, the speaker for
:code:`Talk 11` is unable to speak on the second day.
:code:`Talk 11` is unable to speak on the first day.

We can enter this new constraint::

>>> events[10].add_unavailability(slots[9:])
>>> events[10].add_unavailability(*slots[9:])

We can now solve the problem one more time from scratch just as before::

Expand Down Expand Up @@ -238,6 +237,7 @@ old schedule::
City tour at 16-Sep-2016 13:00 in Outside



Spotting the Changes
--------------------
It can be a little difficult to spot what has changed when we compute a new schedule and so
Expand Down Expand Up @@ -345,10 +345,10 @@ As you can see, we have set all unavailabilities to be empty however
has informed us that they are not present on the first day. We can include these
constraints::

>>> events[0].add_unavailability(chair_slots[4])
>>> events[1].add_unavailability(chair_slots[4])
>>> events[2].add_unavailability(chair_slots[4:])
>>> events[3].add_unavailability(chair_slots[4:])
>>> events[0].add_unavailability(*chair_slots[4])
>>> events[1].add_unavailability(*chair_slots[4])
>>> events[2].add_unavailability(*chair_slots[4:])
>>> events[3].add_unavailability(*chair_slots[4:])

Finally, each chair cannot chair more than one session at a time::

Expand All @@ -371,6 +371,7 @@ Now let us get the chair schedule::
Chair A-1 chairing 16-Sep-2016 12:30 in Big
Chair C-1 chairing 16-Sep-2016 12:30 in Small


Validating a schedule
---------------------

Expand Down

0 comments on commit d1326e8

Please sign in to comment.