fixed_charge.fzn 1021 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
array [1..2] of int: Capacity = [150, 160];
array [1..3] of set of int: ProductMachines = [1..1, 2..2, 3..3];
array [1..3] of int: ProductProfit = [6, 4, 7];
array [1..3] of int: RentingCost = [200, 150, 100];
array [1..6] of int: use = [3, 4, 2, 3, 6, 4];
var -450..2720: INT____00001 :: is_defined_var :: var_is_introduced;
array [1..3] of var 0..160: Produce :: output_array([1..3]);
array [1..3] of var 0..1: Rent :: output_array([1..3]);
var -450..2720: z :: output_var = INT____00001;
constraint int_lin_eq([-1, 6, 4, 7, -200, -150, -100], [INT____00001, Produce[1], Produce[2], Produce[3], Rent[1], Rent[2], Rent[3]], 0) :: defines_var(INT____00001);
constraint int_lin_le([1, -160], [Produce[1], Rent[1]], 0);
constraint int_lin_le([1, -160], [Produce[2], Rent[2]], 0);
constraint int_lin_le([1, -160], [Produce[3], Rent[3]], 0);
constraint int_lin_le([3, 2, 6], [Produce[1], Produce[2], Produce[3]], 150);
constraint int_lin_le([4, 3, 4], [Produce[1], Produce[2], Produce[3]], 160);
solve maximize INT____00001;