Guest User

Untitled

a guest
Sep 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. from pulp import *
  2.  
  3. # The 2 variables Beef and Chicken are created with a lower limit of zero
  4. x1 = LpVariable("Exposures24", 0, 30, LpInteger)
  5. x2 = LpVariable("Exposures36", 0, 30, LpInteger)
  6.  
  7. # Create the 'prob' variable to contain the problem data
  8. prob = LpProblem("T's problem", LpMinimize)
  9.  
  10. prob += (11.95*x1 + 14.95*x2) == 729.3
  11.  
  12. prob.solve()
  13.  
  14. # The status of the solution is printed to the screen
  15. print("Status:", LpStatus[prob.status])
  16.  
  17. # Each of the variables is printed with it's resolved optimum value
  18. for v in prob.variables():
  19. print(v.name, "=", v.varValue)
Add Comment
Please, Sign In to add comment