Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative scenarios #212

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Leonhard-B
Copy link
Contributor

These scenarios save time by reuse of existing model instances. In a first step the dictionaries containing the data to be changed will be updated. Afterwards the scenario function also adapts the corresponding constraints of the model instance. Once the model is solved all changes need to be undone. This allows future utilization of the model instance in other scenarios.
Creation of completely new scenarios types is very complex now.
timing of new scenarios

@Leonhard-B
Copy link
Contributor Author

Leonhard-B commented Nov 28, 2018

I think the complexity of the new scenario creation should be discussed. For people with little urbs knowledge it will be quite hard to built a new scenario function. If you have any wishes or doubts: Let me know. I will try to find a solution for it.
I also changed the documentation for the new scenario type. If important, please have a look at my changes.

@Leonhard-B
Copy link
Contributor Author

Something I just found: The .h5 file saves prob._data and prob._result. prob._data does not contain valid data any more, since only the data of the base scenario is stored there. This is due to the structure of the alternative scenarios.
I will fix this soon, but the save function will probably look worse afterwards.

@maledo
Copy link
Contributor

maledo commented Dec 4, 2018

If you change anything regarding the input of the data dict, keep in mind the copy vs. pointer problematic in python. Sometimes you want to create a copy not just a pointer to the old object, that if you change something, the original variable is changed, too.

Balz added 3 commits December 5, 2018 12:51
…is still split up into r_in, r_out, r_in_min_fraction and r_out_min_fraction, as used in the model.
@Leonhard-B
Copy link
Contributor Author

Saving of the h5 file should work properly, now.

@Leonhard-B
Copy link
Contributor Author

It is possible now, to use both original and new version of scenario creation. If "alternative" appears in the scenario name, an existing model instance is being reused to speed up the process of scenario creation. If no scenario_base or another alternative scenario had run before, a new model instance is created first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants