sending values to the gams model

18 views
Skip to first unread message

dheer

unread,
May 24, 2012, 1:41:27 AM5/24/12
to gamsworld
HI,,

Can anyone tell me how to pass two dimensional data to the gams model
through java code...

Example :


SETS i plants /plant1*plant14/
j markets /market1*market10/;


parameter cost(i,j) transportation cost from i plant to j market;


now i need to send the cost details from java code... so can you pleas
any body tell me how can i do that.. i am searching for this from last
1 month....

Cheers,
dheer.

任彦

unread,
May 24, 2012, 5:25:33 AM5/24/12
to gamsworld

> HI,
> Can anyone tell me how to pass two dimensional data to the gams model
> through java code...

write your 2D data into a GDX file in Java using the GAMS gdx api for Java.
then load your data from that file in GAMS.

%GAMSInstallDir%\apifiles\Java\example1.java gives an example.

HTH,

Yan

Edson Cordeiro do Valle

unread,
May 24, 2012, 11:49:34 AM5/24/12
to gams...@googlegroups.com
   Hello
If you want to trigger GAMS from Java you can use something like in this page:

If your cost data is in a database, you can use sql2gams to transfer it to ".inc" files and then import them to GAMS.
The results can then be published to a databank again or saved to Excel or something like that.
Regards
Edson

2012/5/24 任彦 <yan...@enintech.com>

--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.




--
       Edson Valle
eds...@gmail.com
Reply all
Reply to author
Forward
0 new messages