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

8 lines
356 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= (lastval(select) + 1) mod N
endif /\
forall(i in 1..N) (select=i-1 -> nbhs[i]);@\Vlabel{line:6:roundrobin:post}@