Java Gams Project advice

Hello,

im solving RMINLP for my master thesis in Gams. I need to evaluate the solution and based on that rerun the solver with different data.
Since Java is the only language im familiar with i chose it as my API language.

I am asking for advice and your opinion on my project meaning if its possible or not.

So the RMINLP is yielding the optimal solution (i assessed it with full enumeration).
Changing the exact same problem to MINLP yields a wrong solution. The solver used in both cases is CONOPT 3 version 3.15I (+ CPLEX in the MINLP case).
(Might this be a bug or is it 100% my own formulation error? i attached a txt cointaining the output im having trouble interpreting.)

So i decided to program my own branch and bound. I need to change Data every iteration and in some cases fix values of the decision variables. .fx()
Im using some of the external functions of stolib in my objective function (is this a problem when using java api?).
Does fixing decision variables reqire me to use addJobFromString(model); instead of addJobFromFile(model) so i can change some ecuations directly in java?
Im aware that there are several methods to pass data between Gams and Java (by a String within the Java code, by the gms file, by gdx). Which one would you recommend, as in which one is the easiest?

Thank you for any advice,
Max




\

Output.txt (7.29 KB)

So i was able to answer some of my questions myself but one important one still remains.
Is it possible to use the stolib functions in the model when using java to provide data?

So i set up my java model like ths:

static String data =" $funclibin stolib stodclib \n" +
"FUNCTION pdfnorm /stolib.pdfnormal /; \n “+
.
.
.
" cost… z = sum(i, pdfnorm(q(i),0,1); \n” +
.
.
.

As soon as i add $funclibin stolib stodclib in the beginning, eclipse throws an error :
GAMS process returns unsuccessfully with return code : 2 [there was a compilation error]
If i copy the model from eclipse to GAMS IDE it works fine.
http://gams.com/testlib/libhtml/stolib01.htm

Do i have to declare the external functions somehow?

I just need Propability density function and cumulative propability density for standard normal distribution.

Thanks for andy advice
Max


On Thursday, May 2, 2013 11:35:53 AM UTC+2, reisc...@googlemail.com wrote:

Hello,

im solving RMINLP for my master thesis in Gams. I need to evaluate the solution and based on that rerun the solver with different data.
Since Java is the only language im familiar with i chose it as my API language.

I am asking for advice and your opinion on my project meaning if its possible or not.

So the RMINLP is yielding the optimal solution (i assessed it with full enumeration).
Changing the exact same problem to MINLP yields a wrong solution. The solver used in both cases is CONOPT 3 version 3.15I (+ CPLEX in the MINLP case).
(Might this be a bug or is it 100% my own formulation error? i attached a txt cointaining the output im having trouble interpreting.)

So i decided to program my own branch and bound. I need to change Data every iteration and in some cases fix values of the decision variables. .fx()
Im using some of the external functions of stolib in my objective function (is this a problem when using java api?).
Does fixing decision variables reqire me to use addJobFromString(model); instead of addJobFromFile(model) so i can change some ecuations directly in java?
Im aware that there are several methods to pass data between Gams and Java (by a String within the Java code, by the gms file, by gdx). Which one would you recommend, as in which one is the easiest?

Thank you for any advice,
Max




\

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Max,

There should be no need to declare anything else than “$funclibin stolib stodclib” to use functions from that library. You need to have the GAMS system directory in your Path so that the library can be found, but you need to have that anyway when using the object oriented GAMS Java API, so I guess that is not an issue for you.
In your working directory you should find a .lst file. That should have more information about the compilation error you got. Could you check, what you find there? And could you also say, which version of GAMS you are using?

Best,
Lutz


On 5/4/2013 11:39 AM, reischl.max@googlemail.com wrote:

So i was able to answer some of my questions myself but one important
one still remains.
Is it possible to use the stolib functions in the model when using java
to provide data?

So i set up my java model like ths:

static String data =" $funclibin stolib stodclib
\n" +
"FUNCTION pdfnorm /stolib.pdfnormal /;
\n “+
.
.
.
" cost… z = sum(i,
pdfnorm(q(i),0,1); \n” +
.
.
.

As soon as i add $funclibin stolib stodclib in the beginning, eclipse
throws an error :
GAMS process returns unsuccessfully with return code : 2 [there was a
compilation error]
If i copy the model from eclipse to GAMS IDE it works fine.
http://gams.com/testlib/libhtml/stolib01.htm

Do i have to declare the external functions somehow?

I just need Propability density function and cumulative propability
density for standard normal distribution.

Thanks for andy advice
Max

On Thursday, May 2, 2013 11:35:53 AM UTC+2, reisc...@googlemail.com wrote:

Hello,

im solving RMINLP for my master thesis in Gams. I need to evaluate
the solution and based on that rerun the solver with different data.
Since Java is the only language im familiar with i chose it as my
API language.

I am asking for advice and your opinion on my project meaning if its
possible or not.

So the RMINLP is yielding the optimal solution (i assessed it with
full enumeration).
Changing the exact same problem to MINLP yields a wrong solution.
The solver used in both cases is CONOPT 3 version 3.15I (+ CPLEX in
the MINLP case).
(Might this be a bug or is it 100% my own formulation error? i
attached a txt cointaining the output im having trouble interpreting.)

So i decided to program my own branch and bound. I need to change
Data every iteration and in some cases fix values of the decision
variables. .fx()
Im using some of the external functions of stolib in my objective
function (is this a problem when using java api?).
Does fixing decision variables reqire me to use
addJobFromString(model); instead of addJobFromFile(model) so i can
change some ecuations directly in java?
Im aware that there are several methods to pass data between Gams
and Java (by a String within the Java code, by the gms file, by
gdx). Which one would you recommend, as in which one is the easiest?

Thank you for any advice,
Max


You received this message because you are subscribed to the Google
Groups “gamsworld” group.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\

Lutz Westermann LWestermann@gams.com
GAMS Development Corporation GAMS Software GmbH
1217 Potomac St. NW, Eupener Str. 135-137
Washington DC, 20007, USA 50933 Cologne, Germany
Fon/Fax: +1 202 342-0180/1 Fon/Fax: +49 221 949-9170/1
http://www.gams.com http://www.gams.de


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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\