For a test problem, check manually (outside GAMS) that the solution satisfies all constraints. If not, your GAMS model may be wrong. If all constraints are satisfied, try using a different solver and see if the same objective value is achieved. If the other solver gets a better result, your current runs may be stopping short of optimality. If the objective ...
Collecting things in a parameter is actually very simple.
set run /.../;
solve m ....
objresult(run,"obj") = m.objval;
objresult(run,"bestbound") = m.objest;
objresult(run,"absgap") = abs(m.objval-m.objest);
By default, Gams/Cplex will try to calculate duals by fixing the integer variables and then resolving as an LP. This is the "final solve". Usually the objectives are the same. In rare cases the final lp can be infeasible or the objective can be different because of an artifact in Cplex (mind-numbing detail: it can return mip solutions obeying the ...
To fix a variable use x.fx(i) = 1. To unfix: x.lo(i) = 0; x.up(i) = 1;.
To relax an integer/binary variable you can use: x.prior(i)=INF;
Documentation of this can be found at the obvious place: https://www.gams.com/latest/docs/UG_Variables.html. Here is an example of how to use this.
The main reason why Pyomo is being used in industry and JuMP is not is that JuMP is a version 0.21.6 package whereas Pyomo is v5.7.3. Naturally, most businesses are not going to use a package with version less than 1.
Also, according to the following discussion, first-class nonlinear optimization support is something for v2.0 (two or three years away):
It is much better to collect all y.l(i) in a parameter with an extra index t, and export that in one swoop. I.e.
* calculate y.l(i)
results(t,i) = y.l(i);
execute_unload "AllResults.gdx", results;
execute 'gdxxrw.exe AllResults.gdx par=results';
Calls to Excel are expensive so they should ...
You cannot loop over include files ($include is compile-time, while loop is execution- time, this is similar to say C where you cannot loop over #include). One could loop over complete GAMS models (call gams inside a loop), or over reading data from GDX (GAMS data) files. But often a better approach is the following.
I would just read in all problem data in ...
The latest JuMP.jl website gives a few examples of its use in industry:
route school buses by the Boston school district
plan powergrid expansion by PSR
optimize milk output by dairy farmers in New Zealand
I personally find JuMP.jl, by far, the most user-friendly and flexible optimization interface I ever used. By far.
Unfortunately, GAMS does not have an independent low-level API language (such as CPLEX or Gurobi) and you will need to use its high-level language into your favourite API. In the simplest form, you can write your optimization problem in the gams file (.gms) and invoke it in python as follows:
# transport1 example in the gams directory
from __future__ import ...
This analogy might help: CPU usage is like the power output of an engine - more is better in terms of performance. Memory usage is more like the heat produced by the engine - too much heat, aka memory capacity exceeded, and the engine breaks down.
There is simply no reason in trying to increase or even max out memory usage.
As @ErwinKalvelagen pointed out: by default gams cplex uses only 1 thread which results in a low usage of the pc ressources.
In order to change this one has to increase the thread number so that multiple cores can be used at the same time:
While ago, I asked such a question and GAMS answer was:
I try solving a VRP problem with the below results without the gap option:
Iteration log . . .
Iteration: 1 Dual objective = 124.000000
Root relaxation solution time = 0.00 sec. (0.10 ticks)
Node Left Objective ...