An easy question for JAVA developers AND external model formulation! thanks

Hi everybody,

I am trying to write a GDX file, but it’s hard to link the .java with
my gams model. I don’t understand how to add the java API to my
Netbeans project, because there isnt a .jar file in the gams folders.

So, anyone could tell me exactly what to, and how to, add to my
netbeans project ? I have a bunch of ,java, .c and .dll in
apifiles\java\api in my GAMS folder, but without a .jar file I dont
know how to use them!!

And one more question, does anyone here know how to store my model
formulation, and command the .gms file to read it ? I dont want to
write my model in the GAMS environment, just want to use GAMS to solve
the model cause he has the solvers!

Thanks for the help, I appreciate it!

\

Lucas
Bellow are some answers:

2012/6/10 Lucas Ianni

Hi everybody,

I am trying to write a GDX file, but it’s hard to link the .java with
my gams model. I don’t understand how to add the java API to my
Netbeans project, because there isnt a .jar file in the gams folders.

The java gdx api uses JNI (Java Native Interface) where part of the code is in java and part is in C. I’ve never work with java-gdx but I used JNI in the past and know that you’ll have to compile tha .C code and generate your own .jar.

I suggest you to use other I/O system for your model rather than .gdx, such as text file, excel, Odbc, and others it will be easier.
I have some experience with java/gams using odbc/jodbc, If you want I can give you some consulting.


So, anyone could tell me exactly what to, and how to, add to my
netbeans project ? I have a bunch of ,java, .c and .dll in
apifiles\java\api in my GAMS folder, but without a .jar file I dont
know how to use them!!

And one more question, does anyone here know how to store my model
formulation, and command the .gms file to read it ?

Your model and solve statements are in the .gms file and you can trigger gams using the command line from java, take a look at:
http://interfaces.gams-software.com/doku.php?id=env:spawning_gams_from_java

I dont want to
write my model in the GAMS environment, just want to use GAMS to solve
the model cause he has the solvers!




Thanks for the help, I appreciate it!


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.



\

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.

I dont want to write my model in the GAMS environment, just want to use GAMS to solve
the model because he has the solvers!
I am afraid you’ll have to rewrite your model in GAMS before calling a solver shipping with GAMS;
or why not call a solver such as Bomin or Ipopt directly?

HTH,

Yan


\

Edson and Yan,

Thanks A LOT for the help! You are answering, indirectly, some
questions I have about GAMS.

The purpose I am using GAMS is the solvers! I don’t work in a company
and have to optimize any kind of data base or stuff, I am using the
program for academics purposes!

My objective is to put a objective function, like x+y=10 and some
restrictions like x>0 and y>0 and call CPLEX or BARON ( Especially
this, because it can solve non linear equations!! ) to find the
answer.

So, Edson, I appreciate your help cause you really scared me out with
this data base thing haha, and showed me that maybe GAMS its not the
ideal program for my research!
And Yan, thanks for the help about the rewrite the model in GAMS, I
was afraid of that…

It’s possible to call solvers for LP or NLP, directly ? Maybe this is
what I am looking for…

Thanks again!!

2012/6/12 任彦 :

I dont want to write my model in the GAMS environment, just want to use GAMS to solve
the model because he has the solvers!
I am afraid you’ll have to rewrite your model in GAMS before calling a solver shipping with GAMS;
or why not call a solver such as Bomin or Ipopt directly?

HTH,

Yan


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.


\

Lucas
As Yan said, depending on the type of the model, you can solve it with Ipopt, Bonmin (in this case you must know some C/C++ programming), or even in Excel (for small and “well behaved” problems ).
I think GAMS is a good alternative because have some free solvers. I don’t understand why you don’t want to use the GAMS IDE to run your models since it is an academic work.
Regards

2012/6/13 Lucas Ianni

Edson and Yan,

Thanks A LOT for the help! You are answering, indirectly, some
questions I have about GAMS.

The purpose I am using GAMS is the solvers! I don’t work in a company
and have to optimize any kind of data base or stuff, I am using the
program for academics purposes!

My objective is to put a objective function, like x+y=10 and some
restrictions like x>0 and y>0 and call CPLEX or BARON ( Especially
this, because it can solve non linear equations!! ) to find the
answer.

So, Edson, I appreciate your help cause you really scared me out with
this data base thing haha, and showed me that maybe GAMS its not the
ideal program for my research!
And Yan, thanks for the help about the rewrite the model in GAMS, I
was afraid of that…

It’s possible to call solvers for LP or NLP, directly ? Maybe this is
what I am looking for…

Thanks again!!

2012/6/12 任彦 :

I dont want to write my model in the GAMS environment, just want to use GAMS to solve
the model because he has the solvers!
I am afraid you’ll have to rewrite your model in GAMS before calling a solver shipping with GAMS;
or why not call a solver such as Bomin or Ipopt directly?

HTH,

Yan


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.


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.



\

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.

Edson,

My big problem is I dont have the model !! In my research I was
intending to the user enter with the equations to be optimized. So, I
was wanting to make a program in Java to people enter with the problem
and it call the solver, cplex or baron.

But I dont see GAMS with a solution for me anymore, because this
database stuff and the difficulties associated with the program ( like
make a new model every function I want to solve ) showed me that its
more rational find a way to call directly the solvers. Do you agree ?

2012/6/13 Edson Cordeiro do Valle :

      Lucas

As Yan said, depending on the type of the model, you can solve it with
Ipopt, Bonmin (in this case you must know some C/C++ programming), or even
in Excel (for small and “well behaved” problems ).
I think GAMS is a good alternative because have some free solvers. I don’t
understand why you don’t want to use the GAMS IDE to run your models since
it is an academic work.
Regards

2012/6/13 Lucas Ianni

Edson and Yan,

Thanks A LOT for the help! You are answering, indirectly, some
questions I have about GAMS.

The purpose I am using GAMS is the solvers! I don’t work in a company
and have to optimize any kind of data base or stuff, I am using the
program for academics purposes!

My objective is to put a objective function, like x+y=10 and some
restrictions like x>0 and y>0 and call CPLEX or BARON ( Especially
this, because it can solve non linear equations!! ) to find the
answer.

So, Edson, I appreciate your help cause you really scared me out with
this data base thing haha, and showed me that maybe GAMS its not the
ideal program for my research!
And Yan, thanks for the help about the rewrite the model in GAMS, I
was afraid of that…

It’s possible to call solvers for LP or NLP, directly ? Maybe this is
what I am looking for…

Thanks again!!

2012/6/12 任彦 :

I dont want to write my model in the GAMS environment, just want to use
GAMS to solve
the model because he has the solvers!
I am afraid you’ll have to rewrite your model in GAMS before calling a
solver shipping with GAMS;
or why not call a solver such as Bomin or Ipopt directly?

HTH,

Yan


You received this message because you are subscribed to the Google
Groups “gamsworld” group.
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.


“gamsworld” group.
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.


Edson Valle
edsoncv@gmail.com


“gamsworld” group.
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.

\

Lucas
What you are trying to do is very (to say extremely difficult) for the following reasons:

  1. You’ll have to parse the equations. I mean, to interpret all the operations and equations entered by the user, this is not so trivial!
    2)The solvers (cplex or baron) need not just the function evaluations, but also the first and second derivatives ( Gradient and Hessian) for the objective function and constraints.

Well, to execute a generic program to interpret and generate the derivatives, we are talking about 1-3 years of development (assuming you are an experienced programmer). That the reason we have no more than a dozen of good systems like GAMS, let’s say 6 commercial and 6 free environments. So, I suggest you to really think about the pathway of your research. I’m saying this because I have some experience with optimization and Java programming and I can assure you that it is not an easy task.
Regards

2012/6/13 Lucas Ianni

Edson,

My big problem is I dont have the model !! In my research I was
intending to the user enter with the equations to be optimized. So, I
was wanting to make a program in Java to people enter with the problem
and it call the solver, cplex or baron.

But I dont see GAMS with a solution for me anymore, because this
database stuff and the difficulties associated with the program ( like
make a new model every function I want to solve ) showed me that its
more rational find a way to call directly the solvers. Do you agree ?

2012/6/13 Edson Cordeiro do Valle :

      Lucas

As Yan said, depending on the type of the model, you can solve it with
Ipopt, Bonmin (in this case you must know some C/C++ programming), or even
in Excel (for small and “well behaved” problems ).
I think GAMS is a good alternative because have some free solvers. I don’t
understand why you don’t want to use the GAMS IDE to run your models since
it is an academic work.
Regards

2012/6/13 Lucas Ianni

Edson and Yan,

Thanks A LOT for the help! You are answering, indirectly, some
questions I have about GAMS.

The purpose I am using GAMS is the solvers! I don’t work in a company
and have to optimize any kind of data base or stuff, I am using the
program for academics purposes!

My objective is to put a objective function, like x+y=10 and some
restrictions like x>0 and y>0 and call CPLEX or BARON ( Especially
this, because it can solve non linear equations!! ) to find the
answer.

So, Edson, I appreciate your help cause you really scared me out with
this data base thing haha, and showed me that maybe GAMS its not the
ideal program for my research!
And Yan, thanks for the help about the rewrite the model in GAMS, I
was afraid of that…

It’s possible to call solvers for LP or NLP, directly ? Maybe this is
what I am looking for…

Thanks again!!

2012/6/12 任彦 :

I dont want to write my model in the GAMS environment, just want to use
GAMS to solve
the model because he has the solvers!
I am afraid you’ll have to rewrite your model in GAMS before calling a
solver shipping with GAMS;
or why not call a solver such as Bomin or Ipopt directly?

HTH,

Yan


You received this message because you are subscribed to the Google
Groups “gamsworld” group.
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.


“gamsworld” group.
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.


Edson Valle
edsoncv@gmail.com


“gamsworld” group.
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.


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.



\

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.