How to compile single-value parameters into a parameter defined over sets?

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

How to compile single-value parameters into a parameter defined over sets?

Post by Archiver »


Hello all,

So I have a problem in compiling model results in my GAMS model. I generate quite a large number of single-value computed parameters, i.e. they hold only one value. I want to be able to collect all those parameters and assign them into a table parameter. I know I could for instance generate .GDX files for each parameter, and then merge those .GDX files into one, which will do the job. But that seems to be quite a tedious thing to do, and so I am looking for a shortcut of sort.

Thank you in advance for any hints and/or possible solutions.

Ismail

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: How to compile single-value parameters into a parameter defined over sets?

Post by Archiver »


Assume we have the following code:

set
r /r1*r6/
c /c1*c3/;

*-So here, these parameters are the equivalent of the one-value parameter I compute in my model
parameter
a11,a12,a13,
a21,a22,a23,
a31,a32,a33,
a41,a42,a43,
a51,a52,a53,
a61,a62,a63;

a11 = 1;
a12 = 2;
a13 = 3;
a21 = 4;
a22 = 5;
a23 = 6;
a31 = 7;
a32 = 8;
a33 = 9;
a41 = 10;
a42 = 11;
a43 = 12;
a51 = 13;
a52 = 14;
a53 = 15;
a61 = 16;
a62 = 17;
a63 = 18;

So the objective is to actually collect these parameters and put them into a table parameter index over sets r and c.

On Wednesday, March 23, 2016 at 1:37:33 PM UTC+1, Ismail OURAICH wrote:

Hello all,

So I have a problem in compiling model results in my GAMS model. I generate quite a large number of single-value computed parameters, i.e. they hold only one value. I want to be able to collect all those parameters and assign them into a table parameter. I know I could for instance generate .GDX files for each parameter, and then merge those .GDX files into one, which will do the job. But that seems to be quite a tedious thing to do, and so I am looking for a shortcut of sort.

Thank you in advance for any hints and/or possible solutions.

Ismail

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply