Changeset 3255


Ignore:
Timestamp:
Nov 19, 2010 3:32:01 PM (10 years ago)
Author:
jwatson
Message:

Fixing bug in GUROBI plugin - was loading constraint duals into the "value" attribute of a ConstraintData? class (as opposed to the "dual" attribute).

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

Legend:

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

    r3249 r3255  
    255255                        soln.objective['f'].vale=eval(tokens[1])
    256256                    elif (tokens[0] == 'constraint'):
    257                         soln_constraints[tokens[1]].value = eval(tokens[2])
     257                        soln_constraints[tokens[1]].dual = eval(tokens[2])
    258258                    elif (tokens[0] == 'variable'):
    259259                       if tokens[1] != "ONE_VAR_CONSTANT":
  • coopr.plugins/trunk/coopr/plugins/mip/GUROBI_RUN.py

    r3204 r3255  
    173173        if is_discrete is False:
    174174           for con in cons:
     175               # Pi attributes in Gurobi are the constraint duals
    175176               print >>solnfile, "constraint:",con.getAttr(GRB.Attr.ConstrName),":",con.getAttr(GRB.Attr.Pi)
    176177
Note: See TracChangeset for help on using the changeset viewer.