forked from SoftwareDefinedBuildings/XBOS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
48 lines (43 loc) · 1.59 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
TEST_DATE = "2018-05-06 00:00:00 PST"
import pandas as pd
from thermal_model import get_model_per_zone, normal_schedule, dr_schedule, execute_schedule
print "##################################"
print "#### THERMAL MODEL #####"
print "##################################"
models = get_model_per_zone(TEST_DATE) # don't use data after this argument
allactions = None
for zone, model in models.items():
print " #####################################################"
print " Temperature predictions for", zone
temps, actions = execute_schedule(TEST_DATE, normal_schedule, model, 65) # 60 is starting temperature
def action_to_energy(x):
if x == 1:
return 0.3
elif x == 2:
return 5.0
return 0.0
actions = pd.Series(actions)
actions = actions.apply(action_to_energy)
if allactions is None:
allactions = actions
else:
allactions += actions
print temps
# weather model
from weather_model import predict_day as predict_weather_day
print "##################################"
print "#### WEATHER #####"
print "##################################"
print predict_weather_day(TEST_DATE)
# base consumption
from base_consumption import predict_day as predict_consumption_day
print "##################################"
print "#### ENERGY CONSUMPTION #####"
print "##################################"
base = predict_consumption_day(TEST_DATE)
l = min(len(base), len(allactions))
base = base[:l]
allactions = allactions[:l]
allactions.index = base.index
print 'base + hvac energy'
print base + allactions