This environment has been tested in Mac OS Catalina (by MP, v.10.15.2) and in Ubuntu 16.04 OS (by Zhiang Zhang).
This environment wraps EnergyPlus-v-8-7 (MP) and EnergyPlus-v-8-6 (Zhiang Zhang) into the OpenAI gym environment interface.
-
Download EnergyPlus-v-8-7 (or EnergyPlus-v-8-6) from https://energyplus.net/downloads, extract it, and place it to the directory eplus_env/envs/EnergyPlus-8-7-0 (or eplus_env/envs/EnergyPlus-8-6-0).
-
The environment already has BCVTB-1.6.0 (https://simulationresearch.lbl.gov/bcvtb). BCVTB-1.6.0 is compiled with Java-1.8. Make sure you have Java-1.8 on your OS.
-
Start virtual environment
$ virtualenv virt_env --python=python3
$ source virt_env/bin/activate
$ pip install gym
Gym-Eplus is implemented based on EnergyPlus ExternalInterface function. The EnergyPlus model should be configured based on the guidelines here (https://simulationresearch.lbl.gov/bcvtb/releases/latest/doc/manual/tit-EnePluCon.xhtml).
-
Under ExternalInterface, add "Ptolemy" server as the name of external interface.
-
Under ExternalInterface:Schedule, add the name of your external control (e.g., ExternalControl1), type of control (e.g., Temperature) and initial value (e.g., 25)
-
To control thermostat set point, add the name of your external control to "ThermostatSetpoint:SingleCooling"
- Copy EnergyPlus IDF and weather files:
- Copy the IDF file to '/eplus_env/envs/eplus_models/demo_5z/learning/idf/'
- Copy the EPW file to '/eplus_env/envs/weather/'
-
Edit The 'variables' file: The 'variables' file is located at '/eplus_env/envs/eplus_models/demo_5z/learning/cfg/'. Please specify the variables to be retrived from EnergyPlus, and the variables to be sent to EnergyPlus (e.g., external control).
-
Create a new environment: Create a new environment in '/eplus_env/init.py' file. This file sets the paths to: EnergyPlus, weather file, BCVTB, variables, IDF file, and specify the environment name.
See test.py
- Make the environment, env = gym.make('environment name')
- Reset the environment, env.reset()
- Run the environment, env.step()
- Save the data in a DataFrame
- Close the environment, env.close()