Douple vtype for variable created by addVars
AnsweredCould i define 3-index variable using addVars where for the first index when it's value is less than 2 it will be a binary variable, otherwise it will be a continuous varible.
0
-
Hi Nick,
You can add a list of vtypes:
x = m.addVars(3, vtype=[GRB.BINARY]*2 + [GRB.CONTINUOUS])
Cheers,
David0
Please sign in to leave a comment.
Comments
1 comment