Skip to content

Instantly share code, notes, and snippets.

@chkwon
Created March 21, 2015 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chkwon/c66a56977d5f5684b7fb to your computer and use it in GitHub Desktop.
Save chkwon/c66a56977d5f5684b7fb to your computer and use it in GitHub Desktop.
Simple Gurobi Test
using JuMP, Gurobi
m = Model(solver=GurobiSolver())
@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