willu47 / amply

A Python package for AMPL/GMPL datafile parsing
Eclipse Public License 1.0
14 stars 4 forks source link

x in <SET> in parameter definition not handled #9

Closed willu47 closed 2 years ago

willu47 commented 2 years ago

In GNU MathProg files, legal syntax is to include enumeration over a set in a parameter definition subscript domain using x in set_name. For example:

            set REGION := Kenya;
            set TECHNOLOGY := TRLV_1_0;
            set YEAR := 2016 2017 2018 2019 2020;
            param Peakdemand {r in REGION, t in TECHNOLOGY, y in YEAR};

However, this currently raises an error in amply. Omitting the in statement works:

            set REGION := Kenya;
            set TECHNOLOGY := TRLV_1_0;
            set YEAR := 2016 2017 2018 2019 2020;
            param Peakdemand {REGION,TECHNOLOGY,YEAR};