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/mzn/6_round_robin.mzn

13 lines
369 B
MiniZinc

predicate round_robin(array[int] of var bool: nbhs) =
let {
int: N = length(nbhs);
var -1..N-1: select; % Neighbourhood selection
} in if status()=START then
select = -1
else
select = (last_val(select) + 1) mod N
endif
/\ forall(i in 1..N) (
select = i-1 -> nbhs[i] % <-- Post Neighbourhood@\Vlabel{line:6:roundrobin:post}@
);