Defining initial values
Posted: Fri Jun 12, 2020 10:20 pm
However, with the Python API it seems to be harder to access the level values of variables. My intention with the attached code was to manually define initial values for ALL variables in the model and then solve it multiple times. My rationale was that if the initial point was always the same, the solution would also be the same. However, there are some small changes in the objective function. For the present example, the results of 4 runs are:
Obj: 110.47759190140623,
Obj: 110.47759190141258
Obj: 110.47759190457893
Obj: 110.47759190358889
For this particular minimal example the change is almost negligible, but for my actual complete model it could be as much as 3 orders of magnitude.
Any help in how to change my code to be able to achieve exactly the same result while manually defining the initial conditions will be much appreciated. I am using Gams 31 and its Python Interface, with Python 3.8, but the same problem happens with different versions too.
PS: I apologize for this not-so-minimal MWE. I tried to reproduce this issue with smaller models but when a GamsModifier was used to define the Primal of all variables, the optimization results turned out to be consistently the same.