about the 'ask' tool

Dear GAMS users,

This is a fairly easy question I’d say, but I still couldn’t find an answer for it.

I built a model, and now I try to run different runs, while changing one specific set.
e.g. one of my sets is a range of technologies ‘k’, say 1 to 5. And I like to run the model for each technology, thus turning the other options off. I tried the ‘ask’ tool:

*import a set
$call =ask T=integer M=“choose technology” R=“set k/ %s /;” O=k.inc
$include k.inc
display k;

so ‘%s’ is the query that lets me identify technology 1/2/3/4 or 5.

Error message:
44 * Ask Import Filter Version 2.1, Feb 2006
45 * Erwin Kalvelagen, GAMS Development Corp.
46 set k/3/;
**** $194
194 - Symbol redifined - a second data statement for the same symbol or a data statement after an assignment

I don’t understand this. It seems that my original set introduction set k /1*5/ and now the new one set k /%s/ to be tweeked don’t go together too well.

Anyone help? Im gratefull for it :slight_smile:


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Benjamin,

How about:
set k /1*5/;
$call =ask T=integer M=“choose technology” R=“set kk(k) / %s /;” O=kk.inc
$include kk.inc
display k, kk;

When I select ‘3’ as my input, the file kk.inc contains:

  • Ask Import Filter Version 2.1, Feb 2006
  • Erwin Kalvelagen, GAMS Development Corp.
    set kk(k) / 3 /;

–Paul


On Wed, Jun 19, 2013 at 5:44 AM, benjamin visser wrote:


Dear GAMS users,

This is a fairly easy question I’d say, but I still couldn’t find an answer for it.

I built a model, and now I try to run different runs, while changing one specific set.
e.g. one of my sets is a range of technologies ‘k’, say 1 to 5. And I like to run the model for each technology, thus turning the other options off. I tried the ‘ask’ tool:

*import a set
$call =ask T=integer M=“choose technology” R=“set k/ %s /;” O=k.inc
$include k.inc
display k;

so ‘%s’ is the query that lets me identify technology 1/2/3/4 or 5.

Error message:
44 * Ask Import Filter Version 2.1, Feb 2006
45 * Erwin Kalvelagen, GAMS Development Corp.
46 set k/3/;
**** $194
194 - Symbol redifined - a second data statement for the same symbol or a data statement after an assignment

I don’t understand this. It seems that my original set introduction set k /1*5/ and now the new one set k /%s/ to be tweeked don’t go together too well.

Anyone help? Im gratefull for it :slight_smile:


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Well I tried it, but the model still optimizes between all technologies, while I actually need to shut down all options but one. I can assign a new set kk, but then I have to change in the model all variables and parameters with an (k) into ones with (kk). takes a lot of work, I think as much as deleting all other technologies and keep just one.

Isnt there a simpler way to just tweek the model en temporarily let him ignore all technologies but one, even in the variables/parameters associated with (k)?

bonbon, till speaks!

benjamin













Op woensdag 19 juni 2013 11:44:42 UTC+2 schreef benjamin visser het volgende:


Dear GAMS users,

This is a fairly easy question I’d say, but I still couldn’t find an answer for it.

I built a model, and now I try to run different runs, while changing one specific set.
e.g. one of my sets is a range of technologies ‘k’, say 1 to 5. And I like to run the model for each technology, thus turning the other options off. I tried the ‘ask’ tool:

*import a set
$call =ask T=integer M=“choose technology” R=“set k/ %s /;” O=k.inc
$include k.inc
display k;

so ‘%s’ is the query that lets me identify technology 1/2/3/4 or 5.

Error message:
44 * Ask Import Filter Version 2.1, Feb 2006
45 * Erwin Kalvelagen, GAMS Development Corp.
46 set k/3/;
**** $194
194 - Symbol redifined - a second data statement for the same symbol or a data statement after an assignment

I don’t understand this. It seems that my original set introduction set k /1*5/ and now the new one set k /%s/ to be tweeked don’t go together too well.

Anyone help? Im gratefull for it :slight_smile:


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\