You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there again, how can I create a vector of parameters in a JuMP model?
I know I can do as below but I wondered if I could create it differently, just like the other variables with something like @variable(model, y[i=1:2], set = [POI.Parameter(0), POI.Parameter(0)])
model =Model(() -> POI.ParametricOptimizer(GLPK.Optimizer()))
@variable(model, x[i=1:2] >=0)
y = [@variable(model, set=POI.Parameter(0)) for i=1:2]
@constraint(model, 2*x[1] + x[2] + y[1] <=4)
@constraint(model, x[1] +2*x[2] + y[2] <=4)
@constraint(model, (1+y[1])*x[1] +2*x[2] <=4)
@objective(model, Max, sum(c[i]*x[i] for i=1:2))
The text was updated successfully, but these errors were encountered:
Hey there again, how can I create a vector of parameters in a JuMP model?
I know I can do as below but I wondered if I could create it differently, just like the other variables with something like
@variable(model, y[i=1:2], set = [POI.Parameter(0), POI.Parameter(0)])
The text was updated successfully, but these errors were encountered: