forked from rte-france/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bin_packing2.fzn
64 lines (64 loc) · 4.36 KB
/
bin_packing2.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
var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00019 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00025 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00002 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00003 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00005 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00006 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00008 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00009 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00011 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00012 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00014 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00015 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00017 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00018 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00020 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00021 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00023 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00024 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00026 :: is_defined_var :: var_is_introduced;
var 0..4: INT____00027 :: is_defined_var :: var_is_introduced;
array [1..3] of var 1..3: bins :: output_array([1..3]);
var 5..5: capacity = 5;
array [1..3] of var 1..4: weights :: output_array([1..3]);
constraint bool2int(BOOL____00001, INT____00002) :: defines_var(INT____00002);
constraint bool2int(BOOL____00004, INT____00005) :: defines_var(INT____00005);
constraint bool2int(BOOL____00007, INT____00008) :: defines_var(INT____00008);
constraint bool2int(BOOL____00010, INT____00011) :: defines_var(INT____00011);
constraint bool2int(BOOL____00013, INT____00014) :: defines_var(INT____00014);
constraint bool2int(BOOL____00016, INT____00017) :: defines_var(INT____00017);
constraint bool2int(BOOL____00019, INT____00020) :: defines_var(INT____00020);
constraint bool2int(BOOL____00022, INT____00023) :: defines_var(INT____00023);
constraint bool2int(BOOL____00025, INT____00026) :: defines_var(INT____00026);
constraint int_eq(1, weights[3]);
constraint int_eq(3, weights[2]);
constraint int_eq(4, weights[1]);
constraint int_eq_reif(bins[1], 1, BOOL____00001) :: defines_var(BOOL____00001);
constraint int_eq_reif(bins[1], 2, BOOL____00010) :: defines_var(BOOL____00010);
constraint int_eq_reif(bins[1], 3, BOOL____00019) :: defines_var(BOOL____00019);
constraint int_eq_reif(bins[2], 1, BOOL____00004) :: defines_var(BOOL____00004);
constraint int_eq_reif(bins[2], 2, BOOL____00013) :: defines_var(BOOL____00013);
constraint int_eq_reif(bins[2], 3, BOOL____00022) :: defines_var(BOOL____00022);
constraint int_eq_reif(bins[3], 1, BOOL____00007) :: defines_var(BOOL____00007);
constraint int_eq_reif(bins[3], 2, BOOL____00016) :: defines_var(BOOL____00016);
constraint int_eq_reif(bins[3], 3, BOOL____00025) :: defines_var(BOOL____00025);
constraint int_lin_le([1, 1, 1], [INT____00003, INT____00006, INT____00009], 5);
constraint int_lin_le([1, 1, 1], [INT____00012, INT____00015, INT____00018], 5);
constraint int_lin_le([1, 1, 1], [INT____00021, INT____00024, INT____00027], 5);
constraint int_times(weights[1], INT____00002, INT____00003) :: defines_var(INT____00003);
constraint int_times(weights[1], INT____00011, INT____00012) :: defines_var(INT____00012);
constraint int_times(weights[1], INT____00020, INT____00021) :: defines_var(INT____00021);
constraint int_times(weights[2], INT____00005, INT____00006) :: defines_var(INT____00006);
constraint int_times(weights[2], INT____00014, INT____00015) :: defines_var(INT____00015);
constraint int_times(weights[2], INT____00023, INT____00024) :: defines_var(INT____00024);
constraint int_times(weights[3], INT____00008, INT____00009) :: defines_var(INT____00009);
constraint int_times(weights[3], INT____00017, INT____00018) :: defines_var(INT____00018);
constraint int_times(weights[3], INT____00026, INT____00027) :: defines_var(INT____00027);
solve satisfy;