Created
March 21, 2015 04:53
-
-
Save chkwon/f51c334bcae78a1b706f to your computer and use it in GitHub Desktop.
Simple CPLEX Test
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
using JuMP, CPLEX | |
m = Model(solver=CplexSolver()) | |
@defVar(m, x <= 5) | |
@defVar(m, y <= 45) | |
@setObjective(m, Min, x + y) | |
@addConstraint(m, 50x + 24y <= 2400) | |
@addConstraint(m, 30x + 33y <= 2100) | |
status = solve(m) | |
println("Optimal objective: ",getObjectiveValue(m)) | |
println("x = ", getValue(x), " y = ", getValue(y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment