Heating controller with neural thermal model written in Python
Jacek Kowalski
2018-06-24 66a9fb40efe1311b34a3cee3f83f10c6990759af
commit | author | age
425bf7 1 #!/usr/bin/python3
JK 2
3 from lib.ArgParser import get_config, get_model_from_config
4 from lib.Controller import simulate, BruteForceController, CostController, ReplayController, ThermostatController
5 from lib.Cost import NegativeCost, NegativeCostExtendedRange
6 from lib.Env import CentralHeatingHistoryEnv
7
8 # ARGS
9 config = get_config(uses_future=True)
10
11 # MODEL
12 model = get_model_from_config(config)
13
14 # PLOT
15 config['plot_fields'] = ['time', 'temp_in_calc', 'temp_out', 'temperature', 'mode_calc']
16 config['future_values'] += config['model_future_values']
17
18 # ENV
19 env = CentralHeatingHistoryEnv()
20 env.model = model
21 env.config = config
22 env.cost_class = NegativeCostExtendedRange
23 env.reset()
24
25 # MAIN
26 # controller = BruteForceController(model=model, cost_calculator_class=NegativeCost, config=config)
27 controller = ThermostatController(19.6, 20.4)
28 # controller = ReplayController()
29 simulate(env, controller)