[AMPL 24609] Sets/Parameters Declaration

Is there a way of grouping all sets using one word

Instead of:
set A;
set B;
set C;
I only want to use the word set once like:
set A,B,C;

This also applies to parameters or variables declaration. It becomes very repetitive if the model has many sets or variables.

John

AMPL does not have a syntax like that; you have to write

set A;
set B;
set C;

The same is true of parameters and variables. It is rare that an AMPL model has a very large number of sets, however; also it is rare to have many simple definitions like param p; or var x; without any indexing expressions, bounds, or other qualifications.

Can you give an example of a model that you would like to write, where set A, B, C; or param p1, p2, p3; would be very helpful? Maybe there is a better way to do it that would not involve so much typing.

AMPL does not have a syntax like that; you have to write

set A;
set B;
set C;

The same is true of parameters and variables. It is rare that an AMPL model has a very large number of sets, however; also it is rare to have many simple definitions like “param p;” or “var x;” without any indexing expressions, bounds, or other qualifications.

Can you give an example of a model that you would like to write, where “set A; set B; set C;” or “param p1; param p2; param p3;” would be very helpful? Maybe there is a better way to do it that would not involve so much typing.