Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. SOLVER_NL = IpoptSolver()
  2.  
  3. m4 = Model(solver = SOLVER_NL)
  4.  
  5. N,T = 10,12
  6. to=10
  7. @variable(m4, y[i=1:N, t=1:T])
  8.  
  9. @objective(m4, Min, sum(y[i,to] for i=1:N))
  10. for t=to+1:T
  11. @constraint(m4,sum(y[i,t] for i=1:N)==0)
  12. end
  13. for i=1:N
  14. @constraint(m4,sum(y[i,t] for t=d[i]:f[i])==w[i])
  15. @constraint(m4,sum(y[i,t] for t=1:(d[i]-1))==0)
  16. @constraint(m4,sum(y[i,t] for t=(f[i]+1):T)==0)
  17. end
  18. for t=1:T
  19. @constraint(m4,sum(y[i,t] for i=1:N) <=x_ub)
  20. @constraint(m4,sum(y[i,t] for i=1:N) >=0)
  21. end
  22. for i=1:N,t=1:T
  23. @constraint(m4,y[i,t]>=0)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement