Melina
If you only going to read the inputs from txt and write to txt, no download is required.
The txt reading can be done in GAMS using the $include command.
The txt writing can also be done in GAMS with put statement.
So the java only need to run GAMS.
After the results in txt, you may need to process the .txt in Java.
bellow a small code snippet, I have some experience in this topic and if you want can provide some consulting and codes.
*for reading
Sets myset /
$include my_txt_source.inc
/;
*put your optimization code here.
loop(my_result,
put "here is some text from my variable "/;
** below you write the value of the variable
put “my_result”/;
);
Regards
2012/10/13 Melina Vidoni
Thanks for the answer, it helped. But, I have two more questions:
- Do I need to download something? In this case, what?
- I want to write the inputs of my model in a txt or xml file, and then make that GAMS use that model and that input file to load the parameters. How can I do this?
Thanks again, for taking your time in reading/asnwering.
Greetings.
El sábado, 13 de octubre de 2012 15:17:03 UTC-3, Edsoncv escribió:
You cam find examples here:
http://interfaces.gams-software.com/doku.php?id=env:spawning_gams_from_java
Make a .jar with a similar file from the link above and write a text file with the results (xml, or other) inside gams and make your java process the text file. You can also use JDBC to save the results to databanks, in this case, you need to save a text file with a .sql statements and process it inside Java.
Good luck
2012/10/13 Melina Vidoni
Hello all, I got here after searching in the web for some help on using GAMS in a Java Application, given that I couldn’t find anything that could answer my questions.
What I need is simple: I have a model and the input data, and I want that my Java App call GAMS, and then get the solution to be able to keep working with that. My question is: Is there any library (*.jar) or any tutorial on how to do this? I was able to find a ppt over this topic but it isn’t very deep, and has no possible download links or anything of that kind.
I will apreciatte any hints on this topic.
Thank you for reading.
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/73VrZrqxGycJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
Edson Valle
eds...@gmail.com
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/xq5i1zkUFvYJ.
Edson Valle
edsoncv@gmail.com
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.