Page 1 of 1

Java API - Model results uncorrect after first solve of Modelinstance

Posted: Wed Jan 04, 2023 3:57 pm
by ABMlerGams
Hi,

I am using the Modelinstance over the Java API with a Modifier. All works fine for the first solve. However, results from many solves after the first one are not what I expect. I do clear the Modifier from previous records before re-solving. Thus, I need to re-intantiate the Instance after every solve from the checkpoint which is extremly slower. Can anybody point me to a similar problem with the API after the first solve?

regards,
Karma

Re: Java API - Model results uncorrect after first solve of Modelinstance

Posted: Wed Jan 04, 2023 4:13 pm
by bussieck
Hard to say. Can you produce a self-contained example that lets us reproduce your findings. If you are a paying customer, you can also contact support@gams.com.

-Michael

Re: Java API - Model results uncorrect after first solve of Modelinstance

Posted: Wed Jan 04, 2023 8:25 pm
by ABMlerGams
... well this might be a bit difficult but I might do it if desperate enough. Yes, paying customer at University. Could the fact that I use a MIP play into it? The wrong output entails this piece of info:

MIP start 'm1' defined solution with objective 0.0000.
MIP start 'm2' defined no solution.
1 of 2 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 0.0000.

This part is definitively different from the first solve statement...

Re: Java API - Model results uncorrect after first solve of Modelinstance

Posted: Thu Jan 05, 2023 7:47 am
by bussieck
No, not really. It's just that you get an initial solution. Should not make a difference on the optimal solution. What's your optimality tolerance (optCR). In older versions of GAMS this was at 0.1 by default. Nowadays, it is 1e-6. If you are running an older version perhaps this is the problem.

-Michael

Re: Java API - Model results uncorrect after first solve of Modelinstance

Posted: Thu Jan 05, 2023 7:50 am
by bussieck
You can also "export" the model instance by using the Convert solver. This produces a gams.gms file with the model that gets actually solved. Compare the second model instance with the file that is produces when you start the sequence with the second model instance. They should (with the exception of the .l and .m attributes be identical).

-Michael

Re: Java API - Model results uncorrect after first solve of Modelinstance

Posted: Sat Jan 07, 2023 11:55 am
by ABMlerGams
It was the old GAMS version indeed. Anybody with the same Problem: use the latest GAMS version. Solved for me