coin-or / SHOT

A solver for mixed-integer nonlinear optimization problems
https://shotsolver.dev
Eclipse Public License 2.0
117 stars 25 forks source link

Fix issues with the GAMS integration #4

Closed andreaslundell closed 4 years ago

andreaslundell commented 6 years ago
svigerske commented 4 years ago

The GAMS interface currently passes on threads, optca, optcr, reslim, and iterlim from GAMS to SHOT.

There are some more in GAMS that could make it to SHOT, if there is a good fit:

andreaslundell commented 4 years ago

I will setup the options etc, and then I'll create a PR @svigerske.

svigerske commented 4 years ago

Maybe you can also look at the TODO's at the end of ModelingSystemGAMS::finalizeSolution() :). Two things there:

andreaslundell commented 4 years ago

You want to return the node count to GAMS? They are stored in env->solutionStatistics.numberOfExploredNodes. Note that in the multi-tree strategy, the number of nodes is the sum of the nodes in each individual iteration.

svigerske commented 4 years ago

OK, that's nice.

Is env->solutionStatistics.numberOfIterations ever nonzero? I'm currently using r->getCurrentIteration()->iterationNumber.

We're currently passing the GAMS iteration limit to SHOT in Termination.IterationLimit. I'm not sure what iterations these are, actually, and the limit is by default infinity, but if we could return a corresponding iteration count at the end, that would be nice. Is taking r->getCurrentIteration()->iterationNumber doing that?

andreaslundell commented 4 years ago

The only problem I could see is if there occurs some error before the first iteration (which are LP/MIP iterations) is created. The function getCurrentIteration() only returns the last item of the env->results->iterations vector. So perhaps it would be better to return env->results->iterations.size()?

Actually using env->solutionStatistics.numberOfIterations is better.

andreaslundell commented 4 years ago

I will not implement the gevCheat and gevTryInt parameters now, so I'll close this issue. If there are other GAMS related issues we can create new, more specific, ones.

svigerske commented 4 years ago

Great, thanks. I think there is no need for cheat or tryint, unless there will be a very obvious fit in SHOT.