Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pulp import *
- # The 2 variables Beef and Chicken are created with a lower limit of zero
- x1 = LpVariable("Exposures24", 0, 30, LpInteger)
- x2 = LpVariable("Exposures36", 0, 30, LpInteger)
- # Create the 'prob' variable to contain the problem data
- prob = LpProblem("T's problem", LpMinimize)
- prob += (11.95*x1 + 14.95*x2) == 729.3
- prob.solve()
- # The status of the solution is printed to the screen
- print("Status:", LpStatus[prob.status])
- # Each of the variables is printed with it's resolved optimum value
- for v in prob.variables():
- print(v.name, "=", v.varValue)
Add Comment
Please, Sign In to add comment