Repository containing the benchmark experiments for the MiniZinc Bytecode compiler

Remove tests giving invalid results

-848
-25
flatten/instances.csv
··· 9 9 "stack-cuttingstock","stack-cuttingstock/stack-cutstock-cumu.mzn","stack-cuttingstock/d8.dzn" 10 10 "stack-cuttingstock","stack-cuttingstock/stack-cutstock-cumu.mzn","stack-cuttingstock/d5.dzn" 11 11 "stack-cuttingstock","stack-cuttingstock/stack-cutstock-cumu.mzn","stack-cuttingstock/d7.dzn" 12 - "zephyrus","zephyrus/zephyrus.mzn","zephyrus/12__8__6__3.dzn" 13 - "zephyrus","zephyrus/zephyrus.mzn","zephyrus/14__8__6__3.dzn" 14 - "zephyrus","zephyrus/zephyrus.mzn","zephyrus/14__6__8__3.dzn" 15 - "zephyrus","zephyrus/zephyrus.mzn","zephyrus/12__6__8__3.dzn" 16 - "zephyrus","zephyrus/zephyrus.mzn","zephyrus/14__10__8__3.dzn" 17 12 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/ts225_5.dzn" 18 13 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/u159_4.dzn" 19 14 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/att48_5.dzn" ··· 38 33 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/ulysses16_5.dzn" 39 34 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/ts225_6.dzn" 40 35 "depot-placement","depot-placement/depot_placement.mzn","depot-placement/ulysses22_6.dzn" 41 - "train","train/train.mzn","train/instance.15.dzn" 42 - "train","train/train.mzn","train/instance.2.dzn" 43 - "train","train/train.mzn","train/instance.3.dzn" 44 - "train","train/train.mzn","train/instance.6.dzn" 45 - "train","train/train.mzn","train/instance.12.dzn" 46 - "train","train/train.mzn","train/instance.5.dzn" 47 - "train","train/train.mzn","train/instance.1.dzn" 48 - "train","train/train.mzn","train/instance.13.dzn" 49 - "train","train/train.mzn","train/instance.4.dzn" 50 - "train","train/train.mzn","train/instance.9.dzn" 51 - "train","train/train.mzn","train/instance.14.dzn" 52 - "train","train/train.mzn","train/instance.8.dzn" 53 - "train","train/train.mzn","train/instance.7.dzn" 54 - "train","train/train.mzn","train/instance.11.dzn" 55 - "train","train/train.mzn","train/instance.10.dzn" 56 36 "triangular","triangular/triangular.mzn","triangular/n10.dzn" 57 37 "triangular","triangular/triangular.mzn","triangular/n23.dzn" 58 38 "triangular","triangular/triangular.mzn","triangular/n37.dzn" ··· 152 132 "kidney-exchange","kidney-exchange/ccmcp.mzn","kidney-exchange/3_20_0.30_5.dzn" 153 133 "kidney-exchange","kidney-exchange/ccmcp.mzn","kidney-exchange/3_20_0.25_2.dzn" 154 134 "kidney-exchange","kidney-exchange/ccmcp.mzn","kidney-exchange/3_25_0.20_3.dzn" 155 - "median-string","median-string/median_string_dp.mzn","median-string/p2_2_20-2.dzn" 156 - "median-string","median-string/median_string_dp.mzn","median-string/p1_15_20-1.dzn" 157 - "median-string","median-string/median_string_dp.mzn","median-string/p2_10_8-3.dzn" 158 - "median-string","median-string/median_string_dp.mzn","median-string/p2_10_8-0.dzn" 159 - "median-string","median-string/median_string_dp.mzn","median-string/p2_4_20-0.dzn" 160 135 "road-cons","road-cons/road_naive.mzn","road-cons/road_33.dzn" 161 136 "road-cons","road-cons/road_naive.mzn","road-cons/road_26.dzn" 162 137 "road-cons","road-cons/road_naive.mzn","road-cons/road_25.dzn"
-81
flatten/median-string/median_string_dp.mzn
··· 1 - %------------------------------------------------------------------------------ 2 - % Parameters 3 - 4 - int: num_strings; 5 - int: max_length_strings; 6 - int: max_char; 7 - 8 - int: max_length_median; 9 - 10 - array [1..num_strings, 1..max_length_strings] of int: strings; 11 - array [1..num_strings] of int: str_length; 12 - 13 - 14 - %------------------------------------------------------------------------------ 15 - % Variables 16 - 17 - array [1..max_length_strings] of var 0..max_char: median; 18 - array [1..num_strings] of var 0..2*max_length_strings: distances; 19 - 20 - int: obj_ub = num_strings * 2 * max_length_strings; 21 - var 0..obj_ub: objective; 22 - 23 - %------------------------------------------------------------------------------ 24 - % Predicates 25 - 26 - predicate lcs_global(array[int] of var int: S1, array[int] of var int: S2, var int: ED) = 27 - 28 - let { int: l1 = min(index_set(S1)) - 1; 29 - int: l2 = min(index_set(S2)) - 1; 30 - int: u1 = max(index_set(S1)); 31 - int: u2 = max(index_set(S2)); 32 - array[l1..u1,l2..u2] of var 0..u1+u2: T; } in 33 - T[l1,l2] = 0 /\ 34 - T[u1,u2] = ED /\ 35 - forall(i in l1+1..u1, j in l2+1..u2) 36 - (T[i,j] >= 0 /\ T[i,j] <= i+j) /\ 37 - forall(j in l2+1..u2)(T[l1,j] = j-l2) /\ 38 - forall(i in l1+1..u1)(T[i,l2] = i-l1) /\ 39 - forall(i in l1+1..u1, j in l2+1..u2) 40 - (T[i,j] = if S1[i] = S2[j] then 41 - T[i-1,j-1] 42 - else 43 - if S1[i] = 0 then 44 - T[i-1,j] 45 - else 46 - if S2[j] = 0 then 47 - T[i,j-1] 48 - else 49 - min([T[i-1,j]+1,T[i,j-1]+1]) 50 - endif 51 - endif 52 - endif 53 - ); 54 - 55 - %------------------------------------------------------------------------------ 56 - % Constraints 57 - 58 - constraint forall(i in 1..num_strings)( 59 - lcs_global([strings[i,j] | j in 1..max_length_strings], median, distances[i]) 60 - ); 61 - 62 - constraint forall(i in max_length_median+1..max_length_strings)( 63 - median[i] = 0 64 - ); 65 - 66 - constraint objective = sum(i in 1..num_strings)(distances[i]); 67 - 68 - %------------------------------------------------------------------------------ 69 - % Solve item 70 - 71 - solve 72 - :: int_search(median, input_order, indomain_min, complete) 73 - minimize objective; 74 - 75 - %------------------------------------------------------------------------------ 76 - % Output 77 - 78 - output [ 79 - "median = \(median);\n", 80 - "objective = \(objective);\n" 81 - ];
-6
flatten/median-string/p1_15_20-1.dzn
··· 1 - num_strings=15; 2 - max_length_strings=20; 3 - max_length_median=20; 4 - max_char=4; 5 - strings=[|2,1,2,1,1,1,2,1,2,2,1,1,1,2,1,1,2,2,1,1|2,1,1,1,1,2,1,1,1,2,1,1,2,1,1,2,1,1,2,1|1,1,1,3,1,1,1,1,1,2,1,2,2,2,2,1,1,1,1,1|2,1,2,1,2,1,1,1,2,2,1,2,3,1,1,2,1,1,1,1|1,1,1,1,1,1,1,2,1,1,2,2,1,2,1,1,1,3,2,1|1,1,2,1,1,1,1,1,1,2,1,2,1,2,1,1,1,1,1,1|1,1,1,2,2,1,1,2,1,2,1,1,1,2,1,2,1,1,1,2|2,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1|2,1,1,1,1,2,1,1,2,1,1,1,1,1,1,2,2,2,1,1|2,1,2,2,2,1,1,1,1,1,1,1,1,1,1,2,3,1,2,1|1,3,1,2,1,1,3,1,1,1,1,2,1,2,1,1,1,2,1,2|1,1,2,1,3,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1|1,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,2,2,1,3|1,2,1,2,1,1,2,2,3,1,2,1,1,2,1,1,1,1,2,2|2,1,1,2,2,2,1,2,2,1,1,1,2,2,1,1,1,1,2,1|]; 6 - str_length=[20,20,20,20,20,20,20,20,20,20,20,20,20,20,20];
-6
flatten/median-string/p2_10_8-0.dzn
··· 1 - num_strings=10; 2 - max_length_strings=8; 3 - max_length_median=8; 4 - max_char=4; 5 - strings=[|4,3,4,2,0,0,0,0|2,1,2,4,1,4,0,0|4,0,0,0,0,0,0,0|1,4,3,2,2,3,2,0|3,3,2,3,1,2,0,0|3,0,0,0,0,0,0,0|1,4,3,2,0,0,0,0|1,3,3,3,4,2,3,0|2,1,2,0,0,0,0,0|1,2,3,4,3,0,0,0|]; 6 - str_length=[4,6,1,7,6,1,4,7,3,5];
-6
flatten/median-string/p2_10_8-3.dzn
··· 1 - num_strings=10; 2 - max_length_strings=8; 3 - max_length_median=8; 4 - max_char=4; 5 - strings=[|3,1,2,3,4,1,1,0|1,4,1,4,1,2,0,0|1,3,1,0,0,0,0,0|3,0,0,0,0,0,0,0|4,3,0,0,0,0,0,0|1,4,4,2,3,0,0,0|4,3,2,2,1,3,1,1|2,0,0,0,0,0,0,0|3,3,2,3,4,3,0,0|2,3,4,1,1,2,2,0|]; 6 - str_length=[7,6,3,1,2,5,8,1,6,7];
-6
flatten/median-string/p2_2_20-2.dzn
··· 1 - num_strings=2; 2 - max_length_strings=20; 3 - max_length_median=20; 4 - max_char=4; 5 - strings=[|4,4,4,1,4,3,1,3,4,1,0,0,0,0,0,0,0,0,0,0|2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|]; 6 - str_length=[10,2];
-6
flatten/median-string/p2_4_20-0.dzn
··· 1 - num_strings=4; 2 - max_length_strings=20; 3 - max_length_median=20; 4 - max_char=4; 5 - strings=[|4,4,3,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|4,4,4,4,4,3,4,4,2,0,0,0,0,0,0,0,0,0,0,0|2,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0|]; 6 - str_length=[5,3,9,3];
-12
flatten/train/instance.1.dzn
··· 1 - n = 3; 2 - m = 3; 3 - maxTime = 1140; 4 - delayTime = 5; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5]; 8 - passengerStart = [0,0,0]; 9 - passengerFlow = [0,10,0]; 10 - scheduledArrival = [|0,5,13, |0,15,23, |0,25,33|]; 11 - scheduledDeparture = [|0,8,16, |10,18,26, |20,28,36|]; 12 - capacity = 500;
-12
flatten/train/instance.10.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 15; 5 - delayTrain = 2; 6 - delayDuration = 20; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.11.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 38; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.12.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 25; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.13.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 25; 5 - delayTrain = 2; 6 - delayDuration = 10; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.14.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 25; 5 - delayTrain = 2; 6 - delayDuration = 15; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.15.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 25; 5 - delayTrain = 2; 6 - delayDuration = 20; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.2.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 5; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.3.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 5; 5 - delayTrain = 2; 6 - delayDuration = 10; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.4.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 5; 5 - delayTrain = 2; 6 - delayDuration = 15; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.5.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 5; 5 - delayTrain = 2; 6 - delayDuration = 20; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.6.dzn
··· 1 - n = 4; 2 - m = 4; 3 - maxTime = 1140; 4 - delayTime = 15; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5,5]; 8 - passengerStart = [0,0,6,0]; 9 - passengerFlow = [0,10,10,0]; 10 - scheduledArrival = [|0,5,13,21, |0,15,23,31, |0,25,33,41, |0,35,43,51|]; 11 - scheduledDeparture = [|0,8,16,24, |10,18,26,34, |20,28,36,44, |30,38,46,54|]; 12 - capacity = 500;
-12
flatten/train/instance.7.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 15; 5 - delayTrain = 2; 6 - delayDuration = 5; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.8.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 15; 5 - delayTrain = 2; 6 - delayDuration = 10; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-12
flatten/train/instance.9.dzn
··· 1 - n = 5; 2 - m = 5; 3 - maxTime = 1140; 4 - delayTime = 15; 5 - delayTrain = 2; 6 - delayDuration = 15; 7 - distance = [5,5,5,5]; 8 - passengerStart = [0,0,6,14,0]; 9 - passengerFlow = [0,10,10,10,0]; 10 - scheduledArrival = [|0,5,13,21,29, |0,15,23,31,39, |0,25,33,41,49, |0,35,43,51,59, |0,45,53,61,69|]; 11 - scheduledDeparture = [|0,8,16,24,32, |10,18,26,34,42, |20,28,36,44,52, |30,38,46,54,62, |40,48,56,64,72|]; 12 - capacity = 500;
-176
flatten/train/train.mzn
··· 1 - %----------------------------------------------------------------------------% 2 - %----------------------------------------------------------------------------% 3 - % 4 - % We have n trains moving along a single track with m stations. There is a 5 - % non-zero constant flow of passengers arriving at all but the first and last 6 - % station who wish to travel to the final station. Trains are originally 7 - % scheduled so that they collect the passengers and drop them at the final 8 - % station. To this original schedule a disruption is introduced whereby a train 9 - % is delayed. Each of the trains (at the time of the delay) has knowledge of the 10 - % duration of the delay. The objective is to reschedule the trains to minimize 11 - % the average travel time of the passengers. Trains are not able to overtake 12 - % preceding trains, however they do have the option to 13 - % skip a station and wait longer at a station to collect more passengers. 14 - 15 - %----------------------------------------------------------------------------% 16 - %----------------------------------------------------------------------------% 17 - 18 - %include "globals.mzn"; 19 - 20 - int : n; 21 - int : m; 22 - 23 - int : maxTime; 24 - 25 - 0..maxTime : delayTime; 26 - 1..n : delayTrain; 27 - 0..maxTime : delayDuration; 28 - 29 - array [1..m-1] of 0..maxTime : distance; 30 - 31 - array [1..n, 1..m] of 0..maxTime : scheduledArrival; 32 - array [1..n, 1..m] of 0..maxTime : scheduledDeparture; 33 - 34 - array [1..m] of 0..maxTime : passengerStart; 35 - array [1..m] of 0..maxTime : passengerStop = [scheduledDeparture[n,j] | j in 1..m]; 36 - array [1..m] of int : passengerFlow; 37 - 38 - array [1..n, 1..m] of var 0..maxTime : departure; 39 - array [1..n, 1..m] of var 0..maxTime : arrival; 40 - 41 - array [1..n] of var 0..maxTime : finalArrival = [ arrival[i,m] | i in 1..n ]; 42 - 43 - array [1..n, 1..m] of var 0..maxTime : sigmaLower; 44 - array [1..n, 1..m] of var 0..maxTime : sigmaUpper; 45 - 46 - int : capacity; 47 - 48 - array [1..n, 1..m] of var 0..capacity : collect; 49 - array [1..n, 1..m] of var 0..capacity : load; 50 - 51 - % All trains "arrive" at the first station at time 0. 52 - constraint forall (i in 1..n) 53 - (arrival[i,1] = 0); 54 - % ... and "depart" from the last station as soon as they arrive there. 55 - constraint forall (i in 1..n) 56 - (departure[i,m] = arrival[i,m]); 57 - 58 - % Before the delay, everything runs to schedule. 59 - constraint forall (i in 1..n, j in 1..m-1) 60 - (if scheduledDeparture[i,j] <= delayTime 61 - then departure[i,j] = scheduledDeparture[i,j] 62 - else true 63 - endif); 64 - 65 - % If the train is in motion, then the arrival of the 66 - % delayed train is at least the departure time at the previous station 67 - % plus the ordinary travel time plus the duration of the delay. 68 - int : destinationWhenDelayed = min([j | j in 1..m where scheduledDeparture[delayTrain,j] > delayTime]); 69 - constraint if destinationWhenDelayed > 1 70 - then if delayTime < scheduledDeparture[delayTrain,destinationWhenDelayed-1] + distance[destinationWhenDelayed-1] 71 - then arrival[delayTrain,destinationWhenDelayed] >= 72 - departure[delayTrain,destinationWhenDelayed-1] + delayDuration + distance[destinationWhenDelayed-1] 73 - else true 74 - endif 75 - else true 76 - endif; 77 - % The train's next departure is at least the delay time plus the delay 78 - % duration. 79 - constraint departure[delayTrain, destinationWhenDelayed] >= delayTime + delayDuration; 80 - 81 - % Trains depart after they arrive. 82 - constraint forall (i in 1..n, j in 1..m) 83 - (departure[i,j] >= arrival[i,j]); 84 - 85 - % Trains never leave earlier than scheduled. 86 - constraint forall (i in 1..n, j in 1..m-1) 87 - (departure[i,j] >= scheduledDeparture[i,j]); 88 - 89 - % There is a minimum travel time between stations. 90 - constraint forall (i in 1..n, j in 1..m-1) 91 - (arrival[i,j+1] >= departure[i,j] + distance[j]); 92 - 93 - % At station 1, trains leave in order. 94 - constraint forall (i in 1..n-1) 95 - (departure[i,1] < departure[i+1,1]); 96 - % At most one train dwelling at a station at a given time. 97 - constraint forall (i in 1..n-1, j in 2..m-1) 98 - (departure[i,j] <= arrival[i+1,j]-2); 99 - 100 - % The sigma values partition time at each station. 101 - constraint forall (i in 1..n, j in 1..m) 102 - (sigmaLower[i,j] <= sigmaUpper[i,j]); 103 - 104 - % For the first and last trains, the sigma values are equal to the 105 - % extreme times of passenger arrivals. 106 - constraint forall (j in 2..m-1) 107 - ((sigmaLower[1,j] = passengerStart[j]) 108 - /\ (sigmaUpper[n,j] = scheduledDeparture[n,j])); 109 - % The sigma values join together. 110 - constraint forall (i in 1..n-1, j in 1..m) 111 - (sigmaUpper[i,j] = sigmaLower[i+1,j]); 112 - 113 - % You can't pick up people after you leave. 114 - constraint forall (i in 1..n-1, j in 1..m-1) 115 - (sigmaUpper[i,j] <= departure[i,j]); 116 - constraint forall (j in 1..m-1) 117 - (sigmaUpper[n,j] <= departure[n,j]); 118 - 119 - % Defines collect and load variables. 120 - constraint forall (i in 1..n, j in 1..m) 121 - (collect[i,j] = (sigmaUpper[i,j]-sigmaLower[i,j])*passengerFlow[j]); 122 - 123 - constraint forall (i in 1..n) (load[i,1] = collect[i,1]); 124 - constraint forall (i in 1..n, j in 2..m) 125 - (load[i,j] = load[i,j-1] + collect[i,j]); 126 - 127 - % If a train picks anyone up, then it must pick 128 - % everyone up (until it gets full). 129 - constraint forall (i in 1..n, j in 1..m-1) 130 - (sigmaUpper[i,j] > sigmaLower[i,j] -> 131 - ((sigmaUpper[i,j] = departure[i,j]) \/ 132 - (sigmaUpper[i,j] = scheduledDeparture[n,j]) \/ 133 - (load[i,j] + bool2int(sigmaUpper[i,j] < scheduledDeparture[n,j])*passengerFlow[j] > capacity))); 134 - 135 - % Boarding time. 136 - constraint forall (i in 1..n, j in 2..m) 137 - (((capacity-load[i,j-1] < 100) -> (collect[i,j] <= dwell[i,j]*20)) /\ 138 - ((capacity-load[i,j-1] >= 100) -> (collect[i,j] <= dwell[i,j]*50))); 139 - % (Redundant for j>=2 (but necessary for j=1)) 140 - constraint forall (i in 1..n, j in 1..m) 141 - (collect[i,j] <= (departure[i,j]-arrival[i,j])*50); 142 - 143 - array [1..n, 1..m] of var 0..maxTime : dwell; 144 - constraint forall (i in 1..n, j in 1..m) (dwell[i,j] = departure[i,j] - arrival[i,j]); 145 - 146 - int: objective_min = lb(sum(i in 1..n)(load[i,m]*arrival[i,m])); 147 - int: objective_max = ub(sum(i in 1..n)(load[i,m]*arrival[i,m])); 148 - var objective_min..objective_max: objective = sum(i in 1..n)(load[i,m]*arrival[i,m]); 149 - 150 - solve 151 - :: seq_search([ 152 - int_search( 153 - [arrival[i,m-j+1] | j in 1..m, i in 1..n] ++ 154 - [departure[i,m-j+1] | j in 1..m, i in 1..n] ++ 155 - [sigmaUpper[i,m-j+1] | j in 1..m, i in 1..n] ++ 156 - [sigmaLower[i,m-j+1] | j in 1..m, i in 1..n], 157 - input_order, indomain_min, complete 158 - ), 159 - int_search( 160 - array1d(1..n*m, collect) ++ array1d(1..n*m, load) ++ array1d(1..n*m, dwell), 161 - first_fail, indomain_min, complete 162 - ) 163 - ]) 164 - minimize objective; 165 - 166 - output [ 167 - "arrival = array2d(1..", show(n), ", 1..", show(m), ", ", show(arrival), ");\n", 168 - "departure = array2d(1..", show(n), ", 1..", show(m), ", ", show(departure), ");\n", 169 - "sigmaLower = array2d(1..", show(n), ", 1..", show(m), ", ", show(sigmaLower), ");\n", 170 - "sigmaUpper = array2d(1..", show(n), ", 1..", show(m), ", ", show(sigmaUpper), ");\n", 171 - "collect = array2d(1..", show(n), ", 1..", show(m), ", ", show(collect), ");\n", 172 - "load = array2d(1..", show(n), ", 1..", show(m), ", ", show(load), ");\n", 173 - "dwell = array2d(1..", show(n), ", 1..", show(m), ", ", show(dwell), ");\n", 174 - "constraint objective = ", show(objective), ";\n" 175 - ]; 176 -
-18
flatten/zephyrus/12__6__8__3.dzn
··· 1 - comps = 1..4; 2 - ports = 1..4; 3 - multi_provide_ports = 1..5; 4 - locations = 1..48; 5 - resources = 1..1; 6 - requirement_port_nums = [| 7 - 0,8,0,0|0,17,0,0|6,0,0,0|0,0,0,0|]; 8 - provide_port_nums = [| 9 - -1,0,0,0,0|0,-1,-1,0,0|0,0,0,-1,0|0,0,0,0,3|]; 10 - conflicts = [| 11 - false,false,false,false|false,false,true,false|false,false,false,false|false,false,false,false|]; 12 - multi_provides = [| 13 - false,false,false,true|false,false,false,true|false,false,true,false|false,true,false,false|true,false,false,false|]; 14 - costs = [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520]; 15 - resource_provisions = [| 16 - 8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|]; 17 - resource_consumptions = [| 18 - 512|64|512|512|];
-18
flatten/zephyrus/12__8__6__3.dzn
··· 1 - comps = 1..4; 2 - ports = 1..4; 3 - multi_provide_ports = 1..5; 4 - locations = 1..48; 5 - resources = 1..1; 6 - requirement_port_nums = [| 7 - 0,6,0,0|0,13,0,0|8,0,0,0|0,0,0,0|]; 8 - provide_port_nums = [| 9 - -1,0,0,0,0|0,-1,-1,0,0|0,0,0,-1,0|0,0,0,0,3|]; 10 - conflicts = [| 11 - false,false,false,false|false,false,true,false|false,false,false,false|false,false,false,false|]; 12 - multi_provides = [| 13 - false,false,false,true|false,false,false,true|false,false,true,false|false,true,false,false|true,false,false,false|]; 14 - costs = [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520]; 15 - resource_provisions = [| 16 - 8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|]; 17 - resource_consumptions = [| 18 - 512|64|512|512|];
-18
flatten/zephyrus/14__10__8__3.dzn
··· 1 - comps = 1..4; 2 - ports = 1..4; 3 - multi_provide_ports = 1..5; 4 - locations = 1..56; 5 - resources = 1..1; 6 - requirement_port_nums = [| 7 - 0,8,0,0|0,17,0,0|10,0,0,0|0,0,0,0|]; 8 - provide_port_nums = [| 9 - -1,0,0,0,0|0,-1,-1,0,0|0,0,0,-1,0|0,0,0,0,3|]; 10 - conflicts = [| 11 - false,false,false,false|false,false,true,false|false,false,false,false|false,false,false,false|]; 12 - multi_provides = [| 13 - false,false,false,true|false,false,false,true|false,false,true,false|false,true,false,false|true,false,false,false|]; 14 - costs = [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520]; 15 - resource_provisions = [| 16 - 8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|]; 17 - resource_consumptions = [| 18 - 512|64|512|512|];
-18
flatten/zephyrus/14__6__8__3.dzn
··· 1 - comps = 1..4; 2 - ports = 1..4; 3 - multi_provide_ports = 1..5; 4 - locations = 1..56; 5 - resources = 1..1; 6 - requirement_port_nums = [| 7 - 0,8,0,0|0,17,0,0|6,0,0,0|0,0,0,0|]; 8 - provide_port_nums = [| 9 - -1,0,0,0,0|0,-1,-1,0,0|0,0,0,-1,0|0,0,0,0,3|]; 10 - conflicts = [| 11 - false,false,false,false|false,false,true,false|false,false,false,false|false,false,false,false|]; 12 - multi_provides = [| 13 - false,false,false,true|false,false,false,true|false,false,true,false|false,true,false,false|true,false,false,false|]; 14 - costs = [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520]; 15 - resource_provisions = [| 16 - 8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|]; 17 - resource_consumptions = [| 18 - 512|64|512|512|];
-18
flatten/zephyrus/14__8__6__3.dzn
··· 1 - comps = 1..4; 2 - ports = 1..4; 3 - multi_provide_ports = 1..5; 4 - locations = 1..56; 5 - resources = 1..1; 6 - requirement_port_nums = [| 7 - 0,6,0,0|0,13,0,0|8,0,0,0|0,0,0,0|]; 8 - provide_port_nums = [| 9 - -1,0,0,0,0|0,-1,-1,0,0|0,0,0,-1,0|0,0,0,0,3|]; 10 - conflicts = [| 11 - false,false,false,false|false,false,true,false|false,false,false,false|false,false,false,false|]; 12 - multi_provides = [| 13 - false,false,false,true|false,false,false,true|false,false,true,false|false,true,false,false|true,false,false,false|]; 14 - costs = [260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, 520]; 15 - resource_provisions = [| 16 - 8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|8052|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|4026|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|1825|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|16104|]; 17 - resource_consumptions = [| 18 - 512|64|512|512|];
-266
flatten/zephyrus/zephyrus.mzn
··· 1 - % Copyright (c) 2016, Jacopo Mauro. All rights reserved. 2 - % This file is licensed under the terms of the ISC License. 3 - 4 - 5 - % Please note that you will need to set the MiniZinc standard library 6 - % environment variable $MZN_STDLIB_PATH to share/minizinc to include 7 - % the MiniSearch builtins 8 - 9 - include "lex_greatereq.mzn"; 10 - include "lex_less.mzn"; 11 - 12 - int: MAX_INT = 4096; 13 - %%%%%%%%%%%%%%%% 14 - % Input parameters 15 - %%%%%%%%%%%%%%%% 16 - 17 - % components 18 - set of int: comps; 19 - % ports 20 - set of int: ports; 21 - % multiple provide port 22 - set of int: multi_provide_ports; 23 - 24 - % locations 25 - set of int: locations; 26 - % resources 27 - set of int: resources; 28 - 29 - % map of components with their requirements number 30 - array[ comps, ports] of int: requirement_port_nums; 31 - % map of components with their provided multi-ports 32 - % -1 means infinite multi-port provider 33 - array[ comps, multi_provide_ports] of int: provide_port_nums; 34 - % map of components with their conflicts 35 - array[ comps, ports] of bool: conflicts; 36 - % map of multi-ports with their ports 37 - array[ multi_provide_ports, ports] of bool: multi_provides; 38 - 39 - % map of location with their costs 40 - array[ locations ] of int: costs; 41 - % map of locations with the resouces they provide 42 - array[ locations, resources ] of int: resource_provisions; 43 - % map of components with the resources they consume 44 - array[ comps, resources ] of int: resource_consumptions; 45 - 46 - %%%%%%%%%%%%%%%% 47 - % variables 48 - %%%%%%%%%%%%%%%% 49 - % bindings number 50 - array[ multi_provide_ports, ports, comps, comps] of var 0..MAX_INT: bindings; 51 - % components number 52 - array[ comps ] of var 0..MAX_INT: comps_num; 53 - % location to number of component map 54 - array[ locations, comps] of var 0..MAX_INT: comp_locations; 55 - 56 - % total number of components 57 - var 0..MAX_INT: sum_comp; 58 - 59 - %%%%%%%%%%%%%%%% 60 - % constraints (no location) 61 - %%%%%%%%%%%%%%%% 62 - 63 - % bind the total number of components 64 - constraint sum_comp = sum( i in comps)(comps_num[i]); 65 - 66 - % bindings 0 if the multiprovide does not provide port 67 - constraint forall(mport in multi_provide_ports, port in ports) ( 68 - if multi_provides[mport,port] 69 - then true 70 - else forall(i in comps, j in comps) ( bindings[mport,port,i,j] = 0) 71 - endif 72 - ); 73 - 74 - % provides must be greater or equal to bindings & infinite provide port constraints 75 - constraint forall(mport in multi_provide_ports, pcomp in comps) ( 76 - if provide_port_nums[pcomp,mport]=0 77 - then forall(port in ports, rcomp in comps) ( 78 - bindings[mport,port,pcomp,rcomp] = 0 79 - ) 80 - else 81 - if (provide_port_nums[pcomp,mport] = -1) 82 - then forall(port in ports, rcomp in comps) ( 83 - (comps_num[pcomp] = 0) -> (bindings[mport,port,pcomp,rcomp]=0)) 84 - else sum( port in ports, rcomp in comps)( 85 - bindings[mport,port,pcomp,rcomp] ) <= comps_num[pcomp] * provide_port_nums[pcomp,mport] 86 - endif 87 - endif 88 - ); 89 - 90 - % requires must be equal to bindings 91 - % note: here is possible to require also smaller than or equal 92 - constraint forall(port in ports, rcomp in comps) ( 93 - sum( mport in multi_provide_ports, pcomp in comps)( 94 - bindings[mport,port,pcomp,rcomp] ) = comps_num[rcomp] * requirement_port_nums[rcomp,port] 95 - ); 96 - 97 - 98 - % conflict constraints if component provide same port 99 - constraint forall(port in ports, pcomp in comps) ( 100 - if (conflicts[pcomp,port] /\ exists(mport in multi_provide_ports) ( 101 - (multi_provides[mport,port]) /\ provide_port_nums[pcomp,mport] != 0)) 102 - then comps_num[pcomp] <= 1 103 - else true 104 - endif 105 - ); 106 - 107 - % conflict constraints 108 - constraint forall(port in ports, pcomp in comps, rcomp in comps) ( 109 - if (conflicts[rcomp,port] /\ exists(mport in multi_provide_ports) ( 110 - (multi_provides[mport,port]) /\ provide_port_nums[pcomp,mport] != 0)) 111 - then comps_num[pcomp] > 0 -> comps_num[rcomp] = 0 112 - else true 113 - endif 114 - ); 115 - 116 - % unicity constraint 117 - % note that we require that a component does not 118 - % require more than one port provided by a 119 - % multiple provide port 120 - constraint forall(mport in multi_provide_ports, pcomp in comps, rcomp in comps) ( 121 - let 122 - { int: max_req = sum(port in ports) ( 123 - if multi_provides[mport,port] 124 - then requirement_port_nums[rcomp,port] 125 - else 0 126 - endif 127 - ) 128 - } in 129 - if pcomp = rcomp 130 - then 131 - ( comps_num[pcomp] >= max_req -> 132 - sum(port in ports)(bindings[mport,port,pcomp,rcomp]) 133 - <= max_req * (comps_num[rcomp] - 1)) 134 - /\ 135 - ( comps_num[pcomp] < max_req -> 136 - forall (i in 1..max_req)( comps_num[pcomp] = i -> 137 - sum(port in ports)(bindings[mport,port,pcomp,rcomp]) <= i * (i-1) )) 138 - else 139 - ( comps_num[pcomp] >= max_req -> 140 - sum(port in ports)(bindings[mport,port,pcomp,rcomp]) 141 - <= max_req * comps_num[rcomp] ) 142 - /\ 143 - ( comps_num[pcomp] < max_req -> 144 - forall (i in 0..max_req)( comps_num[pcomp] = i -> 145 - sum(port in ports)(bindings[mport,port,pcomp,rcomp]) <= i * comps_num[rcomp] ) ) 146 - endif 147 - ); 148 - 149 - %%%%%%%%%%%%%%%% 150 - % constraints for deciding locations 151 - %%%%%%%%%%%%%%%% 152 - 153 - % map location used or not used 154 - array[ locations ] of var 0..1: used_locations; 155 - constraint forall( l in locations)( 156 - sum(c in comps)(comp_locations[l,c]) = 0 <-> used_locations[l] = 0 157 - ); 158 - 159 - constraint forall( c in comps) ( 160 - sum( l in locations) ( comp_locations[l,c]) = comps_num[c] 161 - ); 162 - 163 - 164 - constraint forall( res in resources, loc in locations) ( 165 - sum( comp in comps)( comp_locations[loc,comp] * resource_consumptions[comp,res] ) 166 - <= resource_provisions[loc,res] 167 - ); 168 - 169 - % the number of locations can not be greater than the number of components 170 - % i.e, one component per location in the worst case 171 - constraint sum(i in locations) (used_locations[i]) <= sum_comp; 172 - 173 - %------------------------------------------------------------------------------% 174 - % symmetry constraints (wrap in a unique predicate following minizinc specs 175 - 176 - 177 - constraint symmetry_breaking_constraint( 178 - %if location are equal then first location has more comps than the second 179 - %in lexicographically order (based on the cost) 180 - forall( l1 in locations, l2 in locations)( 181 - if l1 < l2 /\ forall ( r in resources)(resource_provisions[l1,r] = resource_provisions[l2,r] ) 182 - then 183 - if costs[l1] > costs[l2] 184 - then lex_greatereq( 185 - [comp_locations[l2,c] | c in comps], 186 - [comp_locations[l1,c] | c in comps]) 187 - /\ 188 - (used_locations[l1] = 1 -> used_locations[l2] = 1) 189 - else 190 - lex_greatereq( 191 - [comp_locations[l1,c] | c in comps], 192 - [comp_locations[l2,c] | c in comps]) 193 - /\ 194 - (used_locations[l2] = 1 -> used_locations[l1] = 1) 195 - endif 196 - else 197 - true 198 - endif 199 - )); 200 - 201 - 202 - %------------------------------------------------------------------------------% 203 - % Redundant constraints 204 - 205 - %constraint redundant_constraint( 206 - % % Ralf constraints 207 - % forall (rcomp in comps, port in ports)( 208 - % if requirement_port_nums[rcomp,port]!=0 209 - % then 210 - % comps_num[rcomp] > 0 -> sum( mport in multi_provide_ports, pcomp in comps)( 211 - % if provide_port_nums[pcomp,mport] != 0 /\ multi_provides[mport,port] 212 - % then comps_num[pcomp] 213 - % else 0 214 - % endif ) >= requirement_port_nums[rcomp,port] 215 - % else 216 - % true 217 - % endif 218 - % )); 219 - 220 - %------------------------------------------------------------------------------% 221 - % Constraints 222 - constraint 223 - ( sum(l in locations)(comp_locations[l,1]) > 0 224 - \/ sum(l in locations)(comp_locations[l,2]) > 0 225 - ) 226 - /\ forall(x in locations)(comp_locations[x,3] < 2) 227 - /\ forall(x in locations)(comp_locations[x,4] < 2) 228 - ; 229 - 230 - int: obj_min = sum(l in locations)(if costs[l] < 0 then costs[l] else 0 endif); 231 - int: obj_max = sum(l in locations)(if costs[l] > 0 then costs[l] else 0 endif); 232 - var obj_min..obj_max: objective; 233 - 234 - constraint objective = sum(l in locations)(used_locations[l] * costs[l]); 235 - 236 - %------------------------------------------------------------------------------% 237 - % Solve item 238 - 239 - array [locations] of locations: costs_asc = arg_sort(costs); 240 - array [locations] of locations: costs_desc = reverse(costs_asc); 241 - 242 - solve 243 - :: seq_search([ 244 - int_search([used_locations[costs_desc[i]] | i in locations], 245 - input_order, indomain_min, complete), 246 - int_search([comp_locations[l, i] | l in locations, i in comps], 247 - first_fail, indomain_max, complete), 248 - int_search(comps_num, first_fail, indomain_max, complete), 249 - int_search([bindings[m,p,i,j] | m in multi_provide_ports, p in ports, i,j in comps], 250 - first_fail, indomain_max, complete) 251 - ]) 252 - minimize objective; 253 - 254 - %------------------------------------------------------------------------------% 255 - % Output item 256 - 257 - output [ 258 - "bindings = array4d(\(multi_provide_ports), \(ports), \(comps), \(comps), \(bindings));\n", 259 - "comps_num = \(comps_num);\n", 260 - "comp_locations = array2d(\(locations), \(comps), \(comp_locations));\n", 261 - "used_locations = \(used_locations);\n", 262 - "objective = \(objective);\n", 263 - "% [\(objective), \(sum(x in locations)(sum(y in comps)(comp_locations[x,y])))]\n" 264 - ]; 265 - 266 -