How to run different scenarios with the BWF evaluator
If the Python package has been installed, the CLI can be used for running and evaluating different scenarios.
Assuming that the scenario data and configuration is stored in the data folder, and the masterplan is stored in masterplan.yaml, we can evaluate the masterplan by running:
water_futures_battle_run_eval masterplan.yaml data/configuration.yaml
This will run all simulations and evaluations of the interventions specified by the user in masterplan.yaml.
Note that you can only run the BWF evaluator on the present data. If you want to run an evaluation on the future, you have to create the configuration files yourself!
Example: How to investigate the effect of changes in the inflation
In this illustrative example, we assume that we want to use the provided BWF evaluator to investigate the effect of changes in the inflation. For this, we will proceed in the following steps:
- Parse the economy configuration file (this is where the inflation can be set) – note that you might have to adjust the file path depending on your local installation: ```python import pandas as pd
economy_dict = pd.read_excel(“data/economy/economy-dynamic_properties.xlsx”, index_col=’timestamp’, sheet_name=None)
2. Modify the inflation -- here, we simply set it 4% for the years 2025-2049:
```python
inflation_df = economy_dict['inflation']
inflation_df.loc[
pd.date_range('2025', '2049', freq='YS'),
'NL0000'
] = 4
- Save the modified economics configuration – we store it in a new file named ‘economy-my_dynamic_properties’, and keep the original configuration file as a backup: ```python from water_futures_battle.base_model import DynamicProperties
new_economy_dps = DynamicProperties(name=’economy-my_dynamic_properties’, dataframes=economy_dict) new_economy_dps.dump(“data/economy”)
Finally, we have to set the new economics configuration in the `configuration.yaml` file in the data folder -- search for the property `economy-dynamic_properties` and replace the old filename with the new one:
```yaml
economy:
economy-dynamic_properties: ./economy/economy-my_dynamic_properties.xlsx
- Run the BWF evaluator:
water_futures_battle_run_eval masterplan.yaml data/configuration.yaml
You can save the new system status in a custom folder adding at the end of the configuration:
scenario_name: scenario_x