Changeset 1965


Ignore:
Timestamp:
Dec 6, 2009 2:26:40 PM (11 years ago)
Author:
jwatson
Message:

Migrating reduced-cost reads for CPLEX SOL file format into svn.

File:
1 edited

Legend:

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

    r1954 r1965  
    299299                variable_name = None
    300300                variable_value = None
     301                variable_reduced_cost = None
    301302                for i in range(1,len(tokens)):
    302303                   field_name =  string.strip(tokens[i].split('=')[0])
     
    306307                   elif field_name == "value":
    307308                      variable_value = field_value
     309                   elif field_name == "reducedCost":
     310                      variable_reduced_cost = field_value
     311
    308312                # skip the "constant-one" variable, used to capture/retain objective offsets in the CPLEX LP format.
    309313                if variable_name != "ONE_VAR_CONSTANT":
     
    313317                   except:
    314318                       soln.variable[variable_name].value = variable_value
     319                   try:
     320                       soln.variable[variable_name].rc = eval(variable_reduced_cost)
     321                   except:
     322                       soln.variable[variable_name].rc = variable_reduced_cost
    315323            elif tokens[0] == "constraint":
    316324                constraint_name = None
Note: See TracChangeset for help on using the changeset viewer.