I have this model (using cbc solver):
@variable(premex, PRODAMOUNT[op_k in keys(_ORDER_PRODUCTs_ALL), u_k in keys(UNITS), t in TIME], Int, lower_bound = 0)
@objective(
premex,
Min,
sum(
sum(
(
(iszero(
sum(
PRODAMOUNT[op_k, u_k, t] * _PRODUCTs_ALL[op["product"]]["bagSize"]
for (op_k, op) in _ORDER_PRODUCTs_ALL
)
) ? 0 : u["cap"]
) -
sum(
PRODAMOUNT[op_k, u_k, t] * _PRODUCTs_ALL[op["product"]]["bagSize"]
for (op_k, op) in _ORDER_PRODUCTs_ALL
)
) * u["util_cost1"]
for (u_k, u) in UNITS
)
for t in TIME
)
)
for t in TIME
@constraint(
premex,
[u_k in keys(UNITS)],
sum(
PRODAMOUNT[op_k, u_k, t] * _PRODUCTs_ALL[op["product"]]["bagSize"]
for (op_k, op) in _ORDER_PRODUCTs_ALL
)
<= UNITS[u_k]["cap"]
)
end
Objective value: -461275000.00000000
How? Why negative value?
UNITS[u_k][“cap”] and u[“cap”] are the same