How to re-run experiments? #286
-
I've run the script and saved results in a *.tar.gz file. I would like to use the same values stored in the "experiments" file to re-run the simulations. I´ve tried out the following script, but the new simulations do not use the previous results: import os if name == 'main':
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I converted this into a Q&A, which is the more appropriate place for this type of question I am not sure what you are trying to achieve exactly. Do you want to rerun exactly the same experiments? Do you want to rerun the same scenarios but with possibly different policies, or vice versa? Or something else? The stored experiments are loaded as a dataframe. If you want to rerun exactly the same experiments, scenarios, and/or policies, you will have to convert each row in the dataframe back into the appropriate object (i.e., Policy, Scenario) and pass these to perform_experiments. Something like the snippet below should work. This can easily be refined, for example, by first getting only the unique scenarios based on the scenario column and the unique policies based on the policy column and next taking a view on this with just the uncertainties or just the levers. from ema_workbench import Scenario
scenarios = []
for i, row in experiments.iteritems():
scenario_variables = row[uncertainty_names]
scenario = Scenario(f"{i}", **scenario_variables.to_dict())
scenarios.append(scenario) |
Beta Was this translation helpful? Give feedback.
I converted this into a Q&A, which is the more appropriate place for this type of question
I am not sure what you are trying to achieve exactly. Do you want to rerun exactly the same experiments? Do you want to rerun the same scenarios but with possibly different policies, or vice versa? Or something else?
The stored experiments are loaded as a dataframe. If you want to rerun exactly the same experiments, scenarios, and/or policies, you will have to convert each row in the dataframe back into the appropriate object (i.e., Policy, Scenario) and pass these to perform_experiments.
Something like the snippet below should work. This can easily be refined, for example, by first getting only the…