It is highly recommended to use official EnergyPlus Python interface. This project was created before the official one. The project is no-longer maintained.
This environment wraps the EnergyPlus-v-8-6 into the OpenAI gym environment interface.
EnergyPlus is platform dependent. So this repository does not include the EnergyPlus software. Please download the EnergyPlus-v-8-6 from https://energyplus.net/downloads, extract it, and place it to the directory eplus_env/envs/EnergyPlus-8-6-0.
The environment depends on BCVTB-1.6.0 (https://simulationresearch.lbl.gov/bcvtb). There is no need to re-install it since this repository already had it. But BCVTB-1.6.0 is compiled with Java-1.8. Make sure you have Java-1.8 on your OS.
$ virtualenv virt_env --python=python3
$ source virt_env/bin/activate
$ pip install gym
$ pip install -e Gym-Eplus/
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).
A new environment should be registered in eplus_env/init.py file.
EnergyPlus logs its own output. The output will be stored under the directory $pwd/Eplus-env-{environment name}-res{x}/Eplus-env-sub_run{x}/output. The "sub_run" directory is the directory for each episode (each EnergyPlus simulation run period) that the environment runs.
- start_year: EnergyPlus simulation start year, int.
- start_mon: EnergyPlus simulation start month, int.
- start_day: EnergyPlus simulation start day of the month, int.
- start_weekday: EnergyPlus simulation start weekday, int. 0 is Monday.
- env_name: The environment name.
import gym;
import eplus_env;
env = gym.make('Eplus-demo-v1');
curSimTime, ob, isTerminal = env.reset(); # Reset the env (creat the EnergyPlus subprocess)
while not isTerminal:
action = [20, 20];
curSimTime, ob, isTerminal = env.step(action);
curSimTime, ob, isTerminal = env.reset(); # Start a new episode (creat a new EnergyPlus subprocess)
while not isTerminal:
action = [20, 20];
curSimTime, ob, isTerminal = env.step(action);
env.end_env(); # Safe termination of the environment after use.
- Zhiang Zhang and Khee Poh Lam. 2018. Practical implementation and evaluation of deep reinforcement learning control for a radiant heating system. In Proceedings of the 5th Conference on Systems for Built Environments (BuildSys '18). ACM, New York, NY, USA, 148-157. DOI: https://doi.org/10.1145/3276774.3276775