Link EnergyPlus and UCEF using Joe_ep_fmu - SCU-Smart-Grid-CPS/smart-grid-energy-simulation-research GitHub Wiki
Match the IP address
In the UCEF Linux VM
ifconfig
In the output, usually choose the first entry under "inet". Avoid any that say "netmask" or "broadcast"
Change the following:
-
In Windows, go to Joe_ep_fmu folder and open ipconfig.txt. Change the IP to match, keeping the commas.
IP Address: ,123.45.6.7.8, //Input the IP address here
-
In UCEF simName_generated, open config.txt and change the line under
ip_address
Note: At least when using the cluster, it was not necessary to edit Joe_ep_fmu.dll, line 298
File Paths
Socket federate needs to find config.txt. In the Socket.java, find all lines referencing a file path, and match the file path starting with /home/username/.../simName_generated
Controller may need to find the python script, this will be in /home/username/.../simName_generated
Avoid renaming files inside the deployment and generated folders. If you do, be sure to propagate that change to every code that may reference that filepath.
After making these changes, be sure to rebuild.
To Get Useful Data
Date Range
- energyOptTset2hr.py: Change date_range to one of the recommended strings
- Energy Plus set Run Period in .idf
Optimization Type
- Controller.java: check optimizeSet and adaptiveSet variables. Comment out the heat vs cool lines (if you're reading this in the future, instead change the heat boolean)
- energyOptTset2hr.py: Set the heatorcool string to 'heat' or 'cool'. Check booleans adaptive_comfort and occupancy_mode.
After Booting UCEF VM
If you have not done it since powering on the VM, put in terminal
sudo sysctl -p
Common Issues
Simulation starts to run then the entire UCEF VM freezes, or the simulation starts fast then slows down significantly.
Most likely the UCEF VM does not have enough RAM and CPU power. For a single house, each Java process uses 130-180 MB and total usage at least 1.9 Gb of RAM. Recommended minimum: RAM = 4096 MB and CPU = 2.
One of the federates crashes, or Federation Manager says "WARN Federate [] has crashed."
"sending fake resignation because it was too rude to"
Go to simName_deployment/logs and open the most recent log for each federate. Particularly pay attention to the federate that crashed.
java.io.FileNotFoundException
Error message includes Go to the java file for that federate and check the filepaths.
One of the federates Error "federation doesn't exist: simName"
Check the IP in config.txt
If you have not done it since powering on the VM, put in terminal
sudo sysctl -p
If this is a new VM, you may need to modify the following system file. This step only needs to be done once, and then it will work indefinitely. In Terminal
sudo nano /etc/sysctl.conf
Use arrow keys to navigate down the page until the end of the commented section, then copy-paste or type in the following lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Use ctrl + x
then when it asks to save, type y
or Y