How to combine decision variables?
回答済みx = m.addMVar(shape = 3, vtype=GRB.BINARY)
y = m.addMVar(shape = 4, vtype=GRB.INTEGER)
Is there any way to combine these two decision variables in one and make it shape = 7?
TIA
0
-
Hi,
Yes, you can define different variable types for matrix variables. See below where the first three MVar variables are binary and the last four are integers.
m.addMVar(7, vtype=["B" for _ in range(3)] + ["I" for _ in range(4)])
Best regards,
Maliheh
0 -
Thank you!
0
サインインしてコメントを残してください。
コメント
2件のコメント