Changeset 3169


Ignore:
Timestamp:
Oct 28, 2010 5:18:35 PM (10 years ago)
Author:
jwatson
Message:

Adding mipgap processing to the GUROBI solver plugin.

Location:
coopr.plugins/trunk/coopr/plugins/mip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/trunk/coopr/plugins/mip/GUROBI.py

    r3122 r3169  
    119119        script += "sys.path.append('%s')\n" % os.path.dirname(__file__)
    120120        script += "from GUROBI_RUN import *\n"
    121         script += "gurobi_run%s\n" % str((problem_filename, solution_filename))
     121        script += "gurobi_run%s\n" % str((problem_filename, solution_filename, self.mipgap))
    122122        script += "quit()\n"
    123123
  • coopr.plugins/trunk/coopr/plugins/mip/GUROBI_RUN.py

    r3154 r3169  
    1212from gurobipy import *
    1313
    14 def gurobi_run(model_file, soln_file):
     14def gurobi_run(model_file, soln_file, mipgap):
    1515
    1616    # Load the lp model
    1717    model = read(model_file)
     18
     19    # set the mipgap if specified.
     20    if mipgap is not None:
     21       model.setParam("MIPGap", mipgap)
    1822   
    1923    # optimize the model
Note: See TracChangeset for help on using the changeset viewer.