Skip to content

Instantly share code, notes, and snippets.

@barrucadu
Last active July 4, 2019 15:01
Show Gist options
  • Save barrucadu/851ab35cab9780fa2cb0e3782f69ce58 to your computer and use it in GitHub Desktop.
Save barrucadu/851ab35cab9780fa2cb0e3782f69ce58 to your computer and use it in GitHub Desktop.

The roles are: 2i A, 2i B, CR, 2ndline A, 2ndline B

Hard constraints

A rota will always satisfy all of these:

  1. In every week:
    1. Each role must be assigned to exactly one person.
    2. For the 2i rota:
      1. 2i A must be able to do 2i
      2. 2i B must be able to do 2i
      3. 2i A must not be on the same team as 2i B
    3. CR must be able to do CR
    4. For the 2ndline rota:
      1. 2ndline A must be able to do 2ndline
      2. 2ndline B must be able to do 2ndline
  2. A person must:
    1. not be assigned more than one role in the same week
    2. not be assigned a role in a period they cannot do
    3. not be assigned multiple roles in the same 10 working day period if they are on a product team
    4. not be assigned roles on adjacent days

Soft constraints

These will be relaxed if a rota cannot be found:

  1. A SCD can only be assigned a 2i or CR role once every 5 working days

    relax by decrementing the number of days, down to 1, doesn't affect hard constraints 2.3 or 2.4

  2. A non-SCD can only be assigned a 2i or CR role once every 9 working days

    relax by decrementing the number of days, down to 1, doesn't affect hard constraints 2.3 or 2.4

  3. 0 people on a product team can be assigned a role

    relax by incrementing the number of people, up to the number of people on product teams

To figure out

  • Optimise for 2ndline A and 2ndline B being on different teams

  • Rota part-time people pro rata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment