Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SOLVER_NL = IpoptSolver()
- m4 = Model(solver = SOLVER_NL)
- N,T = 10,12
- to=10
- @variable(m4, y[i=1:N, t=1:T])
- @objective(m4, Min, sum(y[i,to] for i=1:N))
- for t=to+1:T
- @constraint(m4,sum(y[i,t] for i=1:N)==0)
- end
- for i=1:N
- @constraint(m4,sum(y[i,t] for t=d[i]:f[i])==w[i])
- @constraint(m4,sum(y[i,t] for t=1:(d[i]-1))==0)
- @constraint(m4,sum(y[i,t] for t=(f[i]+1):T)==0)
- end
- for t=1:T
- @constraint(m4,sum(y[i,t] for i=1:N) <=x_ub)
- @constraint(m4,sum(y[i,t] for i=1:N) >=0)
- end
- for i=1:N,t=1:T
- @constraint(m4,y[i,t]>=0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement