Published August 2025 | Version v2

Code and Data for Policy Tree Optimization

Authors/Creators

Contributors

Supervisor:

Description

This repository contains all the code corresponding to methods and figure generation in the paper below:

Adaptation triggers and indicator interpretability for dynamic reoptimization of reservoir control policies under climate change

Requirements

NumPy, Pandas, Matplotlib, Scipy, Scikit-learn, Seaborn, Numba, multiprocessing, ptreeopt,pickle

Directories

Data: Contains input data for analysis used in the study.

Main_optimization: This folder contains function codes called by Step1_outerloop_reopt_perf.py and supporting function files. This includes the framework for an “outer loop” adaptation policy that establishes indicator thresholds for reoptimization based on recently observed data, and an “inner loop” control policy that undergoes reoptimization according to these thresholds. The inner loop control policies are generated by using the function Step0_Innerloop_Reopt.py. To replicate the results from the experiment, the order is Step0_Innerloop_Reopt.py and then Step1_outerloop_reopt_perf.py. Step 0 takes a significant amount of time to run in serial processing for different windows of observed data.

This directory also contains main_reopt_perf_reevaluate.py, which is used to reevaluate the policies for the training and testing sets, determining the policy actions triggered over time based on feature variables that describe changes in hydrology and demand.

Figures: Directory containing Python scripts to generate Figures 3-8 of the manuscript and data used to plot the figures.

PostProcessing: Directory containing Python scripts on SHAP analysis and sensitivity analysis.

Data preparation and model run

  • The scenario data can be downloaded here. Unzip and move the folders into data/cmip5 and data/lulc.
    • The CMIP5 climate scenarios are from USBR and contain daily reservoir inflows in cfs.
    • The LULC scenarios are from multiple models and have been converted to water demand multipliers as described in Cohen et al. 2021

License: MIT

Files

policyTree-main.zip

Files (21.8 MB)

Name Size
md5:7c243999fdd2df849bea88f9db896c32
21.8 MB Preview Download