Getting StartedΒΆ

  1. Setup Configuration

    Customize the dc_config.json file to specify your DC environment settings. To learn more about the DC parameters you can customize, check Data Center Configuration File

  2. Environment Configuration

    The main environment for wrapping the environments is sustaindc_env.py, which reads configurations from the EnvConfig class and manages the external data sources using managers for weather, carbon intensity, and workload. For instructions how to customize the enviroment configuration, check Main Configuration File

  3. Train Example:

    Specify location inside harl.configs.envs_cfgs.sustaindc.yaml. Specify other algorithm hyperparameteres in harl.configs.algos_cfgs.happo.yaml. User can also specify the choice of reinforcement learning vs baseline agents in the happo.yaml

python train_sustaindc.py --algo happo --exp_name happo
  1. Evaluation Example:

    To evaluate the trained model run:

python eval_sustaindc.py

The results are stored in the SAVE_EVAL folder. This can be modified inside eval_sustaindc.py with other experiment identifiers such as checkpoint, location and run

  1. Running in background mode

If you want to run the SustainDC framework in background mode use:

nohup python PYTHON_SCRIPT > OUTPUT_FILE.txt  &

where PYTHON_SCRIPT is the script you want to run (e.g., train_sustaindc.py) and OUTPUT_FILE is the name of the file that will contain the output (e.g. latest_experiment_output)

  1. Monitor the results

The training logs and the results of each trial are stored in the specified local directory, under a sub-folder called results and can be visualized with TensorBoard by specifying the output directory of the results

Example:

tensorboard --logdir ./results/dcrl/<location>/happo

A detailed description of the configurations are provided in the Custom Use section.