Changeset 3039


Ignore:
Timestamp:
Sep 23, 2010 4:06:39 PM (11 years ago)
Author:
jwatson
Message:

Modified CI computation script to deal with some weirdness in CPLEX abruptly terminating when running Sarah's GEP problem with CVAR as the optimization objective. There is a feasible solution, but no indication of why CPLEX stopped. Reporting bug to IBM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/scripts/computeconf

    r3036 r3039  
    1919from coopr.pysp.ph import *
    2020from coopr.pysp.ef import *
     21
     22# this is a hack, in order to pick up the UndefinedData class. this is needed currently, as
     23# CPLEX is periodically barfing on cvar formulations, yielding an undefined gap. technically,
     24# the gap is defined and the solution is feasible, but a correct fix to the CPLEX plugin
     25# would yield a complete failure to solve cvar problems. see related hacks below, searching
     26# for CVARHACK.
     27from coopr.opt.results.container import *
    2128
    2229# to avoid the pain of user lookup of parameter in t-tables, we provide decent coverage automatically.
     
    270277      xstar_obj = float(ef_results.solution(0).objective['f'].value)  ## DLW to JPW: we need the gap too, and to add/subtract is as necessary.
    271278      xstar_obj_gap = ef_results.solution(0).gap # assuming this is the absolute gap
    272       print "xstar_obj_gap=",xstar_obj_gap
    273       xstar_obj_bound = xstar_obj - xstar_obj_gap
    274       print "Extensive form objective value given xstar="+str(xstar_obj)+"; gap="+str(xstar_obj_gap)+"."
     279      # CVARHACK: is CPLEX barfed, keep trucking and bury our head in the sand.
     280      if type(xstar_obj_gap) is UndefinedData:
     281         xstar_obj_bound = xstar_obj
     282      else:
     283         xstar_obj_bound = xstar_obj - xstar_obj_gap
    275284      # TBD: ADD VERBOSE OUTPUT HERE
    276285
Note: See TracChangeset for help on using the changeset viewer.