Changeset 2638


Ignore:
Timestamp:
May 26, 2010 12:02:32 PM (11 years ago)
Author:
jwatson
Message:

Adding a warning in cases where users specify both the rule and noinitrule keywords in the Constraint and Objective class constructors. If a rule is specified, it will be used.

File:
1 edited

Legend:

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

    r2636 r2638  
    9393        self._constructed=False
    9494
     95
    9596    def clear(self):
    9697        self._data = {}
     
    144145        if pyomo.debug("verbose") or pyomo.debug("normal"):     #pragma:nocover
    145146           print "Construcing objective "+self.name
     147        if (self._no_rule_init is not None) and (self.rule is not None):
     148           print "WARNING: noruleinit keyword is being used in conjunction with rule keyword for objective="+self.name+"; defaulting to rule-based construction"
    146149        if self.rule is None:
    147150           if self._no_rule_init is None:
     
    321324        if pyomo.debug("verbose") or pyomo.debug("normal"):     #pragma:nocover
    322325           print "Construcing constraint "+self.name
     326        if (self._no_rule_init is not None) and (self.rule is not None):
     327           print "WARNING: noruleinit keyword is being used in conjunction with rule keyword for constraint="+self.name+"; defaulting to rule-based construction"       
    323328        if self.rule is None:
    324329           if self._no_rule_init is None:
Note: See TracChangeset for help on using the changeset viewer.