Debian Codegraph @

tests/spec/unit/globals/global_cardinality_closed/globals_global_cardinality_closed_opt.mzn

raw
1 /***
2 !Test
3 solvers: [gecode, chuffed]
4 options:
5 all_solutions: true
6 expected: !Result
7 solution: !SolutionSet
8 - !Solution
9 gcc_x: [6, 7, 6, 8, 6, 9, null, 8, 6, null]
10 gcc_c: [4, 1, 2, 1]
11 - !Solution
12 gcc_x: [6, 7, 6, 8, null, 9, 6, 8, 6, null]
13 gcc_c: [4, 1, 2, 1]
14 - !Solution
15 gcc_x: [6, 7, null, 8, 6, 9, 6, 8, 6, null]
16 gcc_c: [4, 1, 2, 1]
17 - !Solution
18 gcc_x: [6, 7, 9, 8, 6, 9, 6, 8, 6, null]
19 gcc_c: [4, 1, 2, 2]
20 - !Solution
21 gcc_x: [6, 7, 6, 8, 9, 9, 6, 8, 6, null]
22 gcc_c: [4, 1, 2, 2]
23 - !Solution
24 gcc_x: [6, 7, 6, 8, 6, 9, 9, 8, 6, null]
25 gcc_c: [4, 1, 2, 2]
26 ***/
27
28 include "global_cardinality_closed.mzn";
29
30 constraint global_cardinality_closed([3, <>, 3, 5, <>, 6], [3, 5, 6], [2, 1, 1]);
31
32 array [int] of var opt -100..100: gcc_x ::add_to_output = [6, 7, _, 8, _, 9, _, 8, 6, <>];
33 array [int] of var -100..100: gcc_c ::add_to_output = [4, 1, 2, _];
34
35 constraint global_cardinality_closed(gcc_x, [6, 7, 8, 9], gcc_c);
36
37 solve satisfy;