Urgent help needed [Importing results of decision variables from one GAMS file into another file as parameters]

Dear GAMS Friend,

I have a GAMS file say cvar2.gams. By running it we get values of the decision variables as shown in the cvar2.lst file. Now I want to import the values of the decision variables as a parameter in the calculatecost.gams file and want to calculate the values of a equation shown in the attached.

Please help me do this efficiently. Its too cumbersome to do the computation by manually getting input of the decision variables for a larger size problem.

I look forward for your help.

Regards,
Syed


equation.docx (15.5 KB)
calculatecost.gms (5.35 KB)
cvar2.lst (37.6 KB)

Syed: A way could be using a gdx file in the middle of both runs, and then you could connect the two GAMS files.I did two files (the end-side being your file) as an example. A notice: You have to define parameters with different name in the origin side file in order for gdx to work. See the attachments.

Hope to help!
Regards
Claudio





On Wed, Mar 5, 2014 at 9:16 AM, Syed Ali wrote:

Dear GAMS Friend,

I have a GAMS file say cvar2.gams. By running it we get values of the decision variables as shown in the cvar2.lst file. Now I want to import the values of the decision variables as a parameter in the calculatecost.gams file and want to calculate the values of a equation shown in the attached.

Please help me do this efficiently. Its too cumbersome to do the computation by manually getting input of the decision variables for a larger size problem.

I look forward for your help.

Regards,
Syed


onetotheother_startfile_example.gms (674 Bytes)
onetotheother_endfile_example.gms (5.38 KB)

Dear Friend,
Thank you so much.

On Sunday, March 9, 2014 11:49:05 AM UTC+9, Claudio Delpino wrote:

Syed: A way could be using a gdx file in the middle of both runs, and then you could connect the two GAMS files.I did two files (the end-side being your file) as an example. A notice: You have to define parameters with different name in the origin side file in order for gdx to work. See the attachments.

Hope to help!
Regards
Claudio





On Wed, Mar 5, 2014 at 9:16 AM, Syed Ali wrote:

Dear GAMS Friend,

I have a GAMS file say cvar2.gams. By running it we get values of the decision variables as shown in the cvar2.lst file. Now I want to import the values of the decision variables as a parameter in the calculatecost.gams file and want to calculate the values of a equation shown in the attached.

Please help me do this efficiently. Its too cumbersome to do the computation by manually getting input of the decision variables for a larger size problem.

I look forward for your help.

Regards,
Syed


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

\

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/d/optout.

One of the GAMS friends suggested to do like this. see the attached file. Here values are used directly using variable.l
I appreciate your cooperation. We could use two methods for cross validation purposes.

On Wednesday, March 12, 2014 7:20:26 PM UTC+9, Syed Ali wrote:

Dear Friend,
Thank you so much.

On Sunday, March 9, 2014 11:49:05 AM UTC+9, Claudio Delpino wrote:

Syed: A way could be using a gdx file in the middle of both runs, and then you could connect the two GAMS files.I did two files (the end-side being your file) as an example. A notice: You have to define parameters with different name in the origin side file in order for gdx to work. See the attachments.

Hope to help!
Regards
Claudio





On Wed, Mar 5, 2014 at 9:16 AM, Syed Ali wrote:

Dear GAMS Friend,

I have a GAMS file say cvar2.gams. By running it we get values of the decision variables as shown in the cvar2.lst file. Now I want to import the values of the decision variables as a parameter in the calculatecost.gams file and want to calculate the values of a equation shown in the attached.

Please help me do this efficiently. Its too cumbersome to do the computation by manually getting input of the decision variables for a larger size problem.

I look forward for your help.

Regards,
Syed


alimerged.gms (9.17 KB)