I am trying to add constraints to a linear optimization problem in Julia using JuMP. I am using the sum{}
function however, I am having trouble with some of the constraints. Does anyone know how to write "for all" in JuMP (the upside down A)? Here is the code I have so far:
using JuMP
m = Model()
c= [3 5 2 ; 4 3 5 ; 4 5 3 ; 5 4 3 ; 3 5 4]
@variable(m, x[i=1:5,j=1:3] >= 0)
@objective(m,Min,sum{c[i,j]*x[i,j],i=1:5,j=1:3})
for i=1:5
@constraint(m, sum{x[i,j],i,j=1:3} <= 480)
end
What I am trying to get is this:
I am trying to use the for loop as a substitute of "for all i from 1 to 5" however I keep getting errors. Is there another way to do this?