Help with indexed sets

16 views
Skip to first unread message

Víctor Mario Noble Ramos

unread,
May 23, 2016, 12:37:08 PM5/23/16
to AMPL Modeling Language
Hi! I wish you could help me with the model that is attached. Always that I run it I have an unknown error that says "name_of_set" is already defined. I tried running without data first an then I created an little instance for proving but the result was the same.

Thak you!
SMMR.mod
SMMR data.dat

Robert Fourer

unread,
May 24, 2016, 12:50:04 AM5/24/16
to am...@googlegroups.com
When I read your model file into AMPL, I see this error message:

../smmr.mod, line 28 (offset 1943):
syntax error
context: set rho {i in Ni} := {l in >>> L}: <<< i in delta[l];

The problem here is that to the right of the := operator, you have the } in the wrong place; the statement should be

set rho {i in Ni} := {l in L: i in delta[l]};

There is a similar error in defining set ipsilon. Also your definitions of lambda and lambda0 do not use the AMPL syntax for sets; for example you should have

set lambda {l in L, m in M, o in O} := {mm in M, oo in O: mm <> m and oo > o};

I did not reach the "is already defined" error that you describe, however.

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages