There are a few things you must install (outside of the Bonsai Platform) to run the EnergyPlus simulator. As of the latest release of BCVTB there is no longer support for 32-bit systems, so make sure to download 64-bit versions of the JDK and EnergyPlus as well.
Download and install the correct JDK for your system at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Download and install ONLY V8.5 (scroll to end of page), this simulator will not yet work on the latest release of EnergyPlus. https://github.com/NREL/EnergyPlus/releases/tag/v8.5.0
Note on Windows: You will need to first make a new folder at C:\bcvtb before running the .jar and make sure to change the install location to C:\bcvtb, otherwise it won't have the correct write permissions.
Download and install the correct version at https://simulationresearch.lbl.gov/bcvtb/Download
Windows
Go to System -> Advanced system settings -> Environment Variables to set these in Windows.
Example Locations in Windows
Variable | Value |
---|---|
BCVTB_HOME | C:\bcvtb |
BCVTB_JNI_DIR | C:\Program Files\Java\jdk1.8.0_121\include |
ENERGYPLUS_BIN | C:\EnergyPlusV8-5-0 |
JAVA_HOME | C:\Program Files\Java\jdk1.8.0_121\bin |
macOS/Linux
Use export
in macOS or Linux to set these variables into your PATH, making sure the locations are the same as where you installed to. You may wish copy and paste the following (example macOS locations) into your .bash_profile
for future use.
export BCVTB_HOME=/Applications/bcvtb
export BCVTB_JNI_DIR=/usr/bin/java/include
export ENERGYPLUS_BIN=/Applications/EnergyPlus-8-5-0
export JAVA_HOME=/usr/local/java
If you don't already have the Bonsai CLI installed, please complete steps 3 (Install Prerequisistes) and 4 (Setup the Bonsai CLI) of http://docs.bons.ai/guides/getting-started.html to get the CLI running on your computer.
Download this energyplus-sample source code from Github and navigate into its folder in your command prompt. energyplus_simulator.py has various dependencies that need to be installed before the simulator can run. Run pip install -r requirements.txt
to install these.
If you haven't already created a BRAIN on beta.bons.ai, create one now via the Bonsai CLI with bonsai create <your_brain>
.
Load the energyplus.ink Inkling file into your brain with bonsai push
.
Enable training mode for your brain with bonsai train start
.
Connect the energyplus simulator for training. Please note that training may take many hours. Run python energyplus_simulator.py --train-brain=<your_brain>
.
Note: If you restart training, you may need to run run.bat clean
(Windows) or run.sh clean
(macOS/Linux) to cleanup your local drive from the previous run.
When training has hit a sufficient accuracy, disable training mode with bonsai train stop
.
This is done by using predictions from your brain on the latest version (or another version specified) with python energyplus_simulator.py --predict-brain=<your_brain> --predict-version=latest
.