Display particular elements of a set

Hello,

I’ve a parameter t(bus_dc) that reads the value from a GAMS table
(while bus_dc is a set of buses).
I’d like to abort the process if exist buses with t(bus_dc)<0 and
display ALL for which t(bus_dc)<0.

I thought about this:

  • Reading data
    set bus_dc /
    $include bus_dc.in
    /;
    parameter t(bus_dc);
    t(bus_dc)= datinodi(bus_dc,‘THETAMIN’);

set bus_dc_theta_neg(bus_dc);
loop ( bus_dc,
if ( t(bus_dc)<0,
bus_dc_t_neg(bus_dc)=bus_dc;
abort" ********* ATTENTION: exist buses with t < 0
********* ",bus_dc_t_neg;
);
);

In this way I get an error: dimension different - the symbol is
referenced with more/less indices as declared

Any idea?

Thanks

Roberto

\

try this syntax within the loop:

bus_dc_t_neg (bus_dc) = yes ;

it should do the job.
cheers


Le mardi 16 octobre 2012 11:57:58 UTC+2, Robi07 a écrit :

Hello,

I’ve a parameter t(bus_dc) that reads the value from a GAMS table
(while bus_dc is a set of buses).
I’d like to abort the process if exist buses with t(bus_dc)<0 and
display ALL for which t(bus_dc)<0.

I thought about this:

  • Reading data
    set bus_dc /
    $include bus_dc.in
    /;
    parameter t(bus_dc);
    t(bus_dc)= datinodi(bus_dc,‘THETAMIN’);

set bus_dc_theta_neg(bus_dc);
loop ( bus_dc,
if ( t(bus_dc)<0,
bus_dc_t_neg(bus_dc)=bus_dc;
abort" ********* ATTENTION: exist buses with t < 0
********* ",bus_dc_t_neg;
);
);

In this way I get an error: dimension different - the symbol is
referenced with more/less indices as declared

Any idea?

Thanks

Roberto


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/oop5AxqwuDcJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.