AMPL doesn't support defining sets in a loop, or using string expressions
for their names. But you can write
set ABC {SET_U} within {SET_A,SET_B};
to define sets ABC[m] for each m in SET_U. There's an explanation of how to
use this construct in the discussion of "indexed collections of sets" in
section 6.5 of the AMPL book (page 100).
Bob Fourer
4er@...
> -----Original Message-----
> From:
ampl@... [mailto:
ampl@...]
> On Behalf Of Guney Petek [
guneyp@...]
> Sent: Tuesday, June 02, 2009 11:09 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2565] parametric set name possible?
>
>
> Hi,
>
> can set names be parametric?:
>
> for {member in SET_U} {
> set ("ABC" & m) within {a in SET_A, b in SET_B}
> }
>
> thanks \\Guney
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to
ampl@...
To unsubscribe from this group, send email to
ampl+unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/ampl?hl=en-~----------~----~----~----~------~----~------~--~---