commit | author | age
|
425bf7
|
1 |
#!/usr/bin/python3 |
JK |
2 |
|
|
3 |
import functools |
|
4 |
|
|
5 |
from lib.ArgParser import get_config, get_model_from_config |
|
6 |
from lib.Controller import simulate, ReplayController |
|
7 |
from lib.Cost import DeviationCost, NegativeCost |
|
8 |
from lib.Env import CentralHeatingHistoryEnv |
|
9 |
|
|
10 |
# ARGS |
|
11 |
config = get_config() |
|
12 |
|
|
13 |
# MODEL |
|
14 |
model = get_model_from_config(config) |
|
15 |
print(repr(model.model)) |
|
16 |
|
|
17 |
# PLOT |
|
18 |
config['plot_fields'] = ['time', 'temp_in', 'temp_in_calc', 'temp_out', 'temperature', 'mode', 'humidity'] |
|
19 |
config['past_fields'] = ['mode'] |
|
20 |
config['past_values'] = 1 |
|
21 |
config['future_values'] = 0 |
|
22 |
|
|
23 |
# ENV |
|
24 |
env = CentralHeatingHistoryEnv() |
|
25 |
#env.cost_class = DeviationCost |
|
26 |
env.cost_class = functools.partial(NegativeCost, 19.5, 22) |
|
27 |
env.model = model |
|
28 |
env.config = config |
|
29 |
env.reset() |
|
30 |
|
|
31 |
# MAIN |
|
32 |
controller = ReplayController() |
|
33 |
simulate(env, controller) |