Changeset 10892


Ignore:
Timestamp:
Nov 17, 2015 1:40:10 AM (6 years ago)
Author:
gahacke
Message:

fix after design simplification of ComponentDict? prototypes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/examples/pysp/farmer/smps_model/ReferenceModel.py

    r10859 r10892  
    1919#       existence in future releases.
    2020from pyomo.core.beta.dict_objects import ConstraintDict
     21from pyomo.core.base.constraint import _GeneralConstraintData as ConstraintObject
    2122
    2223#
     
    102103
    103104        model.EnforceCattleFeedRequirement[i] = \
    104             (model.CattleFeedRequirement[i] <=
    105              (model.Yield[i] * model.DevotedAcreage[i]) + \
    106              model.QuantityPurchased[i] - \
    107              model.QuantitySubQuotaSold[i] - \
    108              model.QuantitySuperQuotaSold[i])
     105            ConstraintObject(model.CattleFeedRequirement[i] <=
     106                             (model.Yield[i] * model.DevotedAcreage[i]) + \
     107                             model.QuantityPurchased[i] - \
     108                             model.QuantitySubQuotaSold[i] - \
     109                             model.QuantitySuperQuotaSold[i])
    109110        # tag which variable in the above constraint has a stochastic
    110111        # coefficient
     
    114115
    115116        model.LimitAmountSold[i] = \
    116             (model.QuantitySubQuotaSold[i] + \
    117              model.QuantitySuperQuotaSold[i] - \
    118              (model.Yield[i] * model.DevotedAcreage[i]) <= 0.0)
     117            ConstraintObject(model.QuantitySubQuotaSold[i] + \
     118                             model.QuantitySuperQuotaSold[i] - \
     119                             (model.Yield[i] * model.DevotedAcreage[i]) <= 0.0)
    119120        # tag which variable in the above constraint has a stochastic
    120121        # coefficient
Note: See TracChangeset for help on using the changeset viewer.