Changeset 2062


Ignore:
Timestamp:
Dec 29, 2009 2:00:37 PM (10 years ago)
Author:
jwatson
Message:

Added ef-mipgap option to PH scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/ph_script.py

    r2061 r2062  
    8888                  type="string",
    8989                  default=[])
     90parser.add_option("--ef-mipgap",
     91                  help="Specifies the mipgap for the EF solve",
     92                  action="store",
     93                  dest="ef_mipgap",
     94                  type="float",
     95                  default=None)
    9096parser.add_option("--max-iterations",
    9197                  help="The maximal number of PH iterations. Default is 100.",
     
    536542         print "Initializing ef solver with options="+str(options.ef_solver_options)         
    537543         ef_solver.set_options("".join(options.ef_solver_options))
     544      if options.ef_mipgap is not None:
     545         if (options.ef_mipgap < 0.0) or (options.ef_mipgap > 1.0):
     546            raise ValueError, "Value of the mipgap parameter for the EF solve must be on the unit interval; value specified=" + `options.ef_mipgap`
     547         else:
     548            ef_solver.mipgap = options.ef_mipgap
    538549
    539550      ef_solver_manager = SolverManagerFactory(options.solver_manager_type)
Note: See TracChangeset for help on using the changeset viewer.