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
k =7
model =Model(Gurobi.Optimizer)
@variable(model, 0<= v[0:9] <=1)
@variable(model, z[0:9], Bin)
for i in0:9if i == k
fix(z[k], 1.0)
end@constraint(model, v[i] + z[i] >= v[k])
end@constraint(model, sum(z) <=length(z) -1)
I have 10 variables(v0, v1, v2, ..., v9), and be outputed from handwritten digit recognition. They are in range [0, 1].
now i need a Vmodel, and variables satisify the following constraints:
how can i use model.addConstr() to add this OR constraint ?
The text was updated successfully, but these errors were encountered: