Changeset 5776


Ignore:
Timestamp:
May 14, 2012 5:54:10 PM (7 years ago)
Author:
jwatson
Message:

Upgrading Benders example to be compliant with recent "attr"->"suffix" change in naming convention. Also eliminated the price validator in master.py, which was bogus to begin with - and was not being properly invoked.

Location:
coopr.pyomo/trunk/examples/pyomo/benders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/examples/pyomo/benders/master.py

    r5769 r5776  
    7777model.CUTS = Set(within=PositiveIntegers, ordered=True)
    7878
    79 def price_validator(model, value):
    80     return value >= -0.000001
    81 
    8279model.time_price = Param(model.TWOPLUSWEEKS, model.SCEN, \
    83                          model.CUTS, default=0.0, validate=price_validator)
     80                         model.CUTS, default=0.0)
    8481
    8582model.bal2_price = Param(model.PROD, model.SCEN, model.CUTS, \
    86                          default=0.0, validate=price_validator)
     83                         default=0.0)
    8784
    8885model.sell_lim_price = Param(model.PROD, model.TWOPLUSWEEKS, \
    8986                             model.SCEN, model.CUTS, \
    90                              default=0.0, validate=price_validator)
     87                             default=0.0)
    9188
    9289def time1_rule(model):
  • coopr.pyomo/trunk/examples/pyomo/benders/runbenders

    r4627 r5776  
    6464      for p in mstr_inst.PROD:
    6565         for t in mstr_inst.TWOPLUSWEEKS:
    66             mstr_inst.sell_lim_price[p, t, s, i] = inst.Sell[p, t].getattrvalue("Urc")
     66            mstr_inst.sell_lim_price[p, t, s, i] = inst.Sell[p, t].get_suffix_value("Urc")
    6767
    6868   # add the master cut.
Note: See TracChangeset for help on using the changeset viewer.