Created
September 13, 2018 15:06
-
-
Save imohitmayank/404c2e218bb826d7d08694723900b057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The status of the solution is printed to the screen | |
print("Status:", LpStatus[prob.status]) | |
# Output= | |
# Status: Optimal | |
# Each of the variables is printed with it's resolved optimum value | |
for v in prob.variables(): | |
print(v.name, "=", v.varValue) | |
# Output= | |
# Medicine_1_units = 3.0 | |
# Medicine_2_units = 4.0 | |
# The optimised objective function value is printed to the screen | |
print("Total Health that can be restored = ", value(prob.objective)) | |
# Output= | |
# Total Health that can be restored = 155.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment