spine-tools / SpineOpt.jl

A highly adaptable modelling framework for multi-energy systems
https://www.tools-for-energy-system-modelling.org/
GNU General Public License v3.0
58 stars 14 forks source link

Non-deterministic optimization model building #1143

Open joaquimg opened 5 days ago

joaquimg commented 5 days ago

I am running the main.jl script in this PR https://github.com/jump-dev/open-energy-modeling-benchmarks/pull/38

Every time I run it, I get a different mps file.

Rows are certainly and non-deterministic order: image

This might be due to many reasons:

Even if the only issue is order, the models might have heavily varying solution times and might be difficult to debug.

Deterministic behavior would be ideal here.

Tasqu commented 3 days ago

There are a couple of places I think might cause this:

  1. Our use of Dicts in storing JuMP variable and constraint references, as well as other stuff like temporal and stochastic structure information. Essentially anything we store in m.ext[:spineopt]. However, I'm not sure if/how this stuff impacts the JuMP model m generation directly.
  2. Could potentially be caused by the indexing functions we use? I'm not sure if the order of entities is consistent when it is fetched from the database.