reset password
Author Message
rabbott
Posts: 1649
Posted 17:23 Nov 04, 2019 |

While discussing the nurse-rostering MiniZinc model in class this morning, I got confused about how to read the transition function. So I extended the model with additional formatting and comments to clarify how the transition function works. 

While doing that I extended the number of days from 10 to a full two weeks and added a constraint that required the schedule for the second week to be the same as the first week's. (It's the constraint on line 30.) Interestingly, MiniZinc met that constraint without requiring each nurse to start the second week in state 1. (You can see that by examining the output. For example, Nurse 1 ends the first week with an off day followed by a night shift. That leaves Nurse 1 in state 3 at the end of the first week, not state 1. Yet the constraints are still met.)

Last edited by rabbott at 17:27 Nov 04, 2019.
rabbott
Posts: 1649
Posted 19:33 Nov 04, 2019 |

Note also the use of the join function. MiniZinc has a join function similar to Python's join function.