forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bales_of_hay.fzn
98 lines (98 loc) · 5.84 KB
/
bales_of_hay.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
predicate fzn_all_different_int(array [int] of var int: x);
predicate count(array [int] of var int: x, var int: y, var int: c);
predicate fixed_fzn_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, int: b);
predicate global_cardinality(array [int] of var int: x, array [int] of int: cover, array [int] of var int: counts);
predicate maximum_int(var int: m, array [int] of var int: x);
predicate minimum_int(var int: m, array [int] of var int: x);
predicate sliding_sum(int: low, int: up, int: seq, array [int] of var int: vs);
predicate sort(array [int] of var int: x, array [int] of var int: y);
predicate table_bool(array [int] of var bool: x, array [int, int] of bool: t);
predicate table_int(array [int] of var int: x, array [int, int] of int: t);
predicate var_fzn_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, var int: b);
array [1..10] of int: weights = [80, 82, 83, 84, 85, 86, 87, 88, 90, 91];
var 0..50: INT____00003 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00004 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00007 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00008 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00011 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00012 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00015 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00016 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00019 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00020 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00023 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00024 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00027 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00028 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00031 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00032 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00035 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00036 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00039 :: is_defined_var :: var_is_introduced;
var 0..50: INT____00040 :: is_defined_var :: var_is_introduced;
array [1..5] of var 0..50: bales :: output_array([1..5]);
var 1..4: i____00001;
var 1..4: i____00005;
var 1..4: i____00009;
var 1..4: i____00013;
var 1..4: i____00017;
var 1..4: i____00021;
var 1..4: i____00025;
var 1..4: i____00029;
var 1..4: i____00033;
var 1..4: i____00037;
var 2..5: j____00002;
var 2..5: j____00006;
var 2..5: j____00010;
var 2..5: j____00014;
var 2..5: j____00018;
var 2..5: j____00022;
var 2..5: j____00026;
var 2..5: j____00030;
var 2..5: j____00034;
var 2..5: j____00038;
constraint array_var_int_element(i____00001, bales, INT____00003) :: defines_var(INT____00003);
constraint array_var_int_element(i____00005, bales, INT____00007) :: defines_var(INT____00007);
constraint array_var_int_element(i____00009, bales, INT____00011) :: defines_var(INT____00011);
constraint array_var_int_element(i____00013, bales, INT____00015) :: defines_var(INT____00015);
constraint array_var_int_element(i____00017, bales, INT____00019) :: defines_var(INT____00019);
constraint array_var_int_element(i____00021, bales, INT____00023) :: defines_var(INT____00023);
constraint array_var_int_element(i____00025, bales, INT____00027) :: defines_var(INT____00027);
constraint array_var_int_element(i____00029, bales, INT____00031) :: defines_var(INT____00031);
constraint array_var_int_element(i____00033, bales, INT____00035) :: defines_var(INT____00035);
constraint array_var_int_element(i____00037, bales, INT____00039) :: defines_var(INT____00039);
constraint array_var_int_element(j____00002, bales, INT____00004) :: defines_var(INT____00004);
constraint array_var_int_element(j____00006, bales, INT____00008) :: defines_var(INT____00008);
constraint array_var_int_element(j____00010, bales, INT____00012) :: defines_var(INT____00012);
constraint array_var_int_element(j____00014, bales, INT____00016) :: defines_var(INT____00016);
constraint array_var_int_element(j____00018, bales, INT____00020) :: defines_var(INT____00020);
constraint array_var_int_element(j____00022, bales, INT____00024) :: defines_var(INT____00024);
constraint array_var_int_element(j____00026, bales, INT____00028) :: defines_var(INT____00028);
constraint array_var_int_element(j____00030, bales, INT____00032) :: defines_var(INT____00032);
constraint array_var_int_element(j____00034, bales, INT____00036) :: defines_var(INT____00036);
constraint array_var_int_element(j____00038, bales, INT____00040) :: defines_var(INT____00040);
constraint int_le(bales[1], bales[2]);
constraint int_le(bales[2], bales[3]);
constraint int_le(bales[3], bales[4]);
constraint int_le(bales[4], bales[5]);
constraint int_lin_eq([1, 1], [INT____00003, INT____00004], 80);
constraint int_lin_eq([1, 1], [INT____00007, INT____00008], 82);
constraint int_lin_eq([1, 1], [INT____00011, INT____00012], 83);
constraint int_lin_eq([1, 1], [INT____00015, INT____00016], 84);
constraint int_lin_eq([1, 1], [INT____00019, INT____00020], 85);
constraint int_lin_eq([1, 1], [INT____00023, INT____00024], 86);
constraint int_lin_eq([1, 1], [INT____00027, INT____00028], 87);
constraint int_lin_eq([1, 1], [INT____00031, INT____00032], 88);
constraint int_lin_eq([1, 1], [INT____00035, INT____00036], 90);
constraint int_lin_eq([1, 1], [INT____00039, INT____00040], 91);
constraint int_lt(i____00001, j____00002);
constraint int_lt(i____00005, j____00006);
constraint int_lt(i____00009, j____00010);
constraint int_lt(i____00013, j____00014);
constraint int_lt(i____00017, j____00018);
constraint int_lt(i____00021, j____00022);
constraint int_lt(i____00025, j____00026);
constraint int_lt(i____00029, j____00030);
constraint int_lt(i____00033, j____00034);
constraint int_lt(i____00037, j____00038);
solve :: int_search(bales, occurrence, indomain_min, complete) satisfy;