This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
dekker-phd-thesis/assets/listing/back_sgp.essence

12 lines
451 B
Plaintext

language Essence 1.3
given nweeks, ngroups, size : int(1..)@\Vlabel{line:back:essence:pars}@
letting Golfers be new type of size ngroups * size@\Vlabel{line:back:essence:ntype}@
find sched : set (size weeks) of@\Vlabel{line:back:essence:var}@
partition (regular, numParts ngroups, partSize size) from Golfers
such that forAll g1, g2 : Golfers, g1 < g2 .@\Vlabel{line:back:essence:con}@
(sum week in sched . toInt(together({g1, g2}, week))) <= 1