-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate_profiles.py
54 lines (42 loc) · 1.52 KB
/
generate_profiles.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
49
50
51
52
53
54
from hackathon.energy.energy_math import gen_profile
from hackathon.utils.utils import *
import json
__author__ = "Dusan Majstorovic"
__copyright__ = "Typhoon HIL Inc."
__license__ = "MIT"
def generate_profiles():
# Training profiles
#LOAD_SCALES = [1.0, 1.1, 0.8, 1.2, 0.9]
#SOLAR_SCALES = [1.3, 0.4, 0.8, 0.9, 1.1]
#BLACKOUTS = [[[11, 11.75]],
# [],
# [[2.5,3]],
# [[20,21]],
# [],
# ]
# Competition profiles
LOAD_SCALES = [1.0, 0.8, 0.9, 1.1, 1.2]
SOLAR_SCALES = [1.0, 1.5, 1.2, 0.9, 0.5]
BLACKOUTS = [[[22.75,23.25]],
[],
[[13.0,14.0]],
[[2.5,3.25]],
[[18.5,19.25]],
]
PROFILES = []
# used to smoothen out the load PROFILES on day transitions
LOAD_SCALING_PREV = 1.0
for i in CFG.days:
n = i-1
to_write, profile = gen_profile(CFG.sampleRate,
load_scaling=LOAD_SCALES[n],
load_scaling_prev=LOAD_SCALING_PREV,
solar_scaling=SOLAR_SCALES[n],
blackouts=BLACKOUTS[n])
PROFILES += profile
LOAD_SCALING_PREV = LOAD_SCALES[n]
with open('./data/profiles_cmp.json', 'w') as f:
f.write(json.dumps(PROFILES))
print('Profile is generated in {}'.format('./data/profiles_cmp.json'))
if __name__ == '__main__':
generate_profiles()