From 45632eefa257fc63d2fc60ee812e6ed04e32496f Mon Sep 17 00:00:00 2001 From: David Tonhofer Date: Tue, 17 Aug 2021 20:37:32 +0200 Subject: [PATCH] Added alternative to use the lex2(m) from the library --- symmetry/lamp/lamp-dl.mzn | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/symmetry/lamp/lamp-dl.mzn b/symmetry/lamp/lamp-dl.mzn index c8e6f46..e18a044 100644 --- a/symmetry/lamp/lamp-dl.mzn +++ b/symmetry/lamp/lamp-dl.mzn @@ -5,19 +5,25 @@ set of int: COL = 1..b; int: r; int: k; int: lambda; - + array[ROW,COL] of var bool: m; solve satisfy; - + constraint forall(i in ROW)(sum(j in COL)(m[i,j]) = r); constraint forall(j in COL)(sum(i in ROW)(m[i,j]) = k); constraint forall(i1, i2 in ROW where i1 < i2) (sum(j in COL) (m[i1,j] /\ m[i2,j]) = lambda); - -include "double_lex.mzn"; -constraint double_lex(m); - + +% Use the accompanying file "double_lex.mzn" +% include "double_lex.mzn"; +% constraint double_lex(m); + +% Or use the MiniZinc library +% https://www.minizinc.org/doc-2.5.5/en/lib-globals.html?highlight=lex2#index-39 +include "lex2.mzn"; +constraint lex2(m); + output [ if fix(m[i,j]) then "1" else "0" endif ++ if j = b then "\n" else "" endif - | i in ROW, j in COL ]; \ No newline at end of file + | i in ROW, j in COL ];