Changeset 1966


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

Transferring the reduced-cost variable attributes (if present) in the solution to the model instance variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/PyomoModel.py

    r1920 r1966  
    306306             if self._name_varmap[name].fixed is True:
    307307                raise TypeError, "Variable '"+name+"' in model '"+self.name+"' is currently fixed - new value is not expected in solution"
     308
     309             # the value is always present in any legal solution.
    308310             self._name_varmap[name].value = soln.variable[name].value
    309311
     312             # the reduced-cost might be present, depending on what the solver is reporting.
     313             if hasattr(soln.variable[name],"rc"):
     314                self._name_varmap[name].rc = soln.variable[name].rc
    310315
    311316    def write(self,filename=None,format=ProblemFormat.cpxlp):
Note: See TracChangeset for help on using the changeset viewer.