Tuesday, May 20, 2008

surprising GAMS models

I just provided this example:


if(1,
$set name "hello"
else
$set name "world"
);

display "%name%";


which may be surprising to non-expert GAMS users.
Here is one that may even stump hardcore GAMS modelers:


scalar s /NA/;
s$(s>1) = 3.14;
display s;


Question: can you predict the result of the display statement?