SECQUOIA / gdplib

An open library of Generalized Disjunctive Programming (GDP) models
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

med_term_purchasing bug #34

Closed ZedongPeng closed 3 months ago

ZedongPeng commented 5 months ago

Output

Benchmarking instance: med_term_purchasing
Traceback (most recent call last):
  File "/local/scratch/a/peng372/github/gdplib/benchmark.py", line 106, in <module>
    model = import_module("gdplib." + instance).build_model()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/scratch/a/peng372/github/gdplib/gdplib/med_term_purchasing/med_term_purchasing.py", line 144, in build_model
    model.TimePeriod,
    ^^^^^^^^^^^^^^^^
  File "/local/scratch/a/peng372/anaconda3/lib/python3.11/site-packages/pyomo/core/base/block.py", line 550, in __getattr__
    raise AttributeError(
AttributeError: 'AbstractModel' object has no attribute 'TimePeriod'. Did you mean: 'TimePeriods'?
AlbertLee125 commented 5 months ago
model.RegPrice_Discount = Param(
        model.Streams,
        model.TimePeriod,
        doc='Price for quantities less than min amount under discount contract',
    )

There was a typo on this part I will add the s on the model.TimePeriod and resolve this issue.