quaquel / EMAworkbench

workbench for performing exploratory modeling and analysis
BSD 3-Clause "New" or "Revised" License
128 stars 90 forks source link

Tracking convergence not working when using Vensim model #279

Open omarcastrejon opened 1 year ago

omarcastrejon commented 1 year ago

Tracking convergence does not work properly when using a Vensim model. Probably it is because during the optimisation process the 'TIME' variable is added to the levers+outcomes (this shifts the variable names), and therefore the number of columns in the archive ({actual_columns}) does not match the expected number of decision variables and objectives ({expected_columns}). Any advice on how this issue could be solved?

quaquel commented 1 year ago

Without any detailed error and a minimum example, I cannot diagnose this. Your suggested explanation seems strange because TIME is set to INFO and thus should be left out of the optimization results as well as the platypus problem description.

omarcastrejon commented 1 year ago

This is the error I get: image

Tha two extra columns from ArchiveLogger.load_archives(f"./archives/{i}.tar.gz") are: image

quaquel commented 1 year ago

Ok, but this changes what is happening quite a bit. This is an issue in storing the archive for post-run analysis. I am not sure whether I consider this a bug or desired behavior.

The easy workaround is to drop from the archive dataframe the column you don't need. This is one 1 additional line of code: dataframe.drop.

EwoutH commented 1 year ago

@omarcastrejon If you have a specific suggestion to improve this somewhere in the documentation, tutorials or examples, please let me know.

quaquel commented 1 year ago

It's also something to consider as part of the larger optimization rework (See #268). Basically, how do we want to handle INFO outcomes?

omarcastrejon commented 1 year ago

The following is the workaround I implemented for this particular case: image

Probably not the most efficient solution, but it worked well.