Suppose I want an AMPL set to contain the integers 1 through 5. How can I declare this in the .dat file?
I can do it in the .mod file, like this:
things.mod:
set THINGS := 1..5;
Console:
ampl: model things.mod;
ampl: display THINGS;
set THINGS := 1 2 3 4 5;
ampl: display THINGS diff {2};
set THINGS diff {2} := 1 3 4 5;
But now suppose I do this:
things.mod:
set THINGS;
things.dat:
set THINGS := 1..5;
Console:
ampl: model things.mod;
ampl: data things.dat;
ampl: display THINGS;
set THINGS := 1..5;
ampl: display THINGS diff {2};
set THINGS diff {2} := 1..5;
AMPL seems to be treating 1..5 as a string rather than as an sequence of integers. Why, and how do I fix it?