How to only display a specific parameter? Topic is solved

Problems with syntax of GAMS
Post Reply
GAMS_practitioner
User
User
Posts: 9
Joined: 1 year ago

How to only display a specific parameter?

Post by GAMS_practitioner »

Hi Friends,


If you have created a parameter `param(i,j,s)` where `set i /1*500/ s /s1*s200/` and wanted to just display it for `s22` ,for example, how did you do that?

I've tried to run `display param(i,j,"s22")` but it doesn't work. Is there a way to do that?

Also using a loop in GAMS is fast or slow? I mean, should I avoid using loop as much as possible?
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: How to only display a specific parameter?

Post by bussieck »

If you want to browse and filter the data interactively, I recommend GAMS Studio (https://www.gams.com/41/docs/T_STUDIO.html). Create a GDX file with your data (execute_unload 'data.gdx';) and open this in the Studio (https://www.gams.com/41/docs/T_STUDIO.h ... GDX_VIEWER). This allows you to filter on the dimensions, sort, and all kind of things. If you do need the data as part of the listing file with a display, you need to assign first the slice you are interested in and display this since display can only display entire symbols:

Code: Select all

parameter paramSlice;
paramSlice(i,j,'s22') = param(i,j,"s22");
display paramSlice;
-Michael
GAMS_practitioner
User
User
Posts: 9
Joined: 1 year ago

Re: How to only display a specific parameter?

Post by GAMS_practitioner »

Many Manyu Many thanks Michael. I've never heard of that before. Thanks!
Post Reply