@constraint(
premex,
BUHLER1_BUHLER2[op_k in keys(_ORDER_PRODUCTs_ALL), t in TIME],
PRODAMOUNT[op_k, "BUHLER1", t] => {sum(PRODAMOUNT[op_k, "BUHLER2", t] for op_k in keys(_ORDER_PRODUCTs_ALL)) == 0}
)
@constraint(
premex,
BUHLER2_BUHLER1[op_k in keys(_ORDER_PRODUCTs_ALL), t in TIME],
PRODAMOUNT[op_k, "BUHLER2", t] => {sum(PRODAMOUNT[op_k, "BUHLER1", t] for op_k in keys(_ORDER_PRODUCTs_ALL)) == 0}
)
I… maybe I am wrong, but I am not entirely sure this works… what are the {} supposed to mean? Also, => means pair creation, 1 => 2 gives a pair of 1 and 2, it does not mean that 1 should be greater-than-or-equal-to 2.
So let’s analyse BUHLER1_BUHLER2 constraint it says:
if PRODAMOUNT[op_k, “BUHLER1”, t] > 0 then every PRODAMOUNT[op_k, “BUHLER2”, t] should be 0
that way we can manipulate (change) other values based on the value we want. Note that left from => should be Boolean, but luckily julia/jump treats all number != 0 as true (LUCKILY )
Thanks, Oscar, that is exactly what I am looking for! Now I’ve learned that it is possible to nest for loops from your example.
Sorry, but I am learning Julia / Jump just to finish one project started in AMPL by my friend and we have to deliver the final product - a windows application with a user interface and this model and we are already late. So no time for learning, just google it and that is ti.