Spaces:
Sleeping
Sleeping
lfs release
Browse files- .gitattributes +1 -0
- app/__pycache__/core.cpython-311.pyc +0 -0
- app/__pycache__/example_data.cpython-311.pyc +0 -0
- app/app.py +119 -38
- app/dashboard.ipynb +120 -71
- app/data/16NSJNnjLK4MndjZYaKYGKEV.csv +3 -0
- app/data/7uLwefnSt8CgVlmIGY8emqJK.csv +3 -0
- app/data/8yS04Ddkk3pPL8e9Rku4LJtc.csv +3 -0
- app/data/Cwp33jA19hp9VdoNJUlj6USf.csv +3 -0
- app/data/KN9Z3gANLftDuUGvgs8O38dI.csv +3 -0
- app/data/LzbMafI31IosheUI7YGhj5at.csv +3 -0
- app/data/PHqaZDuMTRvCZCvA259Z1vJu.csv +3 -0
- app/data/RZngVU6axOdshmfma0yNAajE.csv +3 -0
- app/data/SQUOjMB6zAgYpSJEMy46tKXJ.csv +3 -0
- app/data/UcufQVoJQPbfLzIBnSsUodJP.csv +3 -0
- app/data/VTuh8oxtC6YlOCLeScXfLuY3.csv +3 -0
- app/data/VZTnyVO3TP3ILuYsN5Xw9UR0.csv +3 -0
- app/data/WyPRjcmBXJZoC9DIURMXKxn8.csv +3 -0
- app/data/iBFIAuvh7bCNyOQDo0jkjhRV.csv +3 -0
- app/data/iNVKpGfGW6rU17eOtxpZSFWR.csv +3 -0
- app/data/kaTMmHVh8gXUbHMppzdmdzpv.csv +3 -0
- app/data/yPtlbyLlDlzeBZQYrPYaByoB.csv +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.csv filter=lfs diff=lfs merge=lfs -text
|
app/__pycache__/core.cpython-311.pyc
ADDED
Binary file (2.49 kB). View file
|
|
app/__pycache__/example_data.cpython-311.pyc
ADDED
Binary file (3.17 kB). View file
|
|
app/app.py
CHANGED
@@ -8,20 +8,16 @@ import numpy as np
|
|
8 |
import example_data
|
9 |
import core
|
10 |
|
11 |
-
|
12 |
outside_temp = example_data.ExampleDailyOutsideTemperature
|
13 |
energy_price = example_data.ExampleDailyEnergyCost
|
14 |
boiler_temperature = example_data.ExampleBoilerTemperature
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
data = pd.DataFrame(columns=['hour', 'energy_consumption', 'confort', 'policy_readable'])
|
19 |
-
data = pd.concat([data, pd.DataFrame({'hour': np.arange(0, 24), 'energy_consumption': energy_price.value, 'confort': np.random.rand(24),
|
20 |
'policy_readable': np.random.choice(['A', 'B', 'C', 'D', 'E'], 24)
|
21 |
})])
|
22 |
debug = False
|
23 |
|
24 |
-
|
25 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
26 |
|
27 |
app = Dash(__name__, external_stylesheets=external_stylesheets)
|
@@ -33,8 +29,7 @@ app.layout = html.Div([
|
|
33 |
|
34 |
server = app.server
|
35 |
|
36 |
-
|
37 |
-
# SOlution options
|
38 |
solution_options = [
|
39 |
"Discrete Optimization",
|
40 |
"Continuous Optimization",
|
@@ -42,6 +37,47 @@ solution_options = [
|
|
42 |
]
|
43 |
solution_options_default_value = solution_options[0]
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
# provide a scalar value to enable the slider to select ideal temperature
|
46 |
ideal_temperature = 50
|
47 |
|
@@ -52,6 +88,14 @@ dashboard_layout = html.Div([
|
|
52 |
#small subtitle that says of solution is possible or not
|
53 |
html.Div(id='solution-status', children='', style={'color': 'lighrgrey'}),
|
54 |
html.Div([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
html.Div([
|
56 |
html.H3('Solution'),
|
57 |
dcc.Dropdown(
|
@@ -79,6 +123,15 @@ dashboard_layout = html.Div([
|
|
79 |
], className='three columns'),
|
80 |
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
], className='row'),
|
83 |
html.Div(
|
84 |
[
|
@@ -91,27 +144,27 @@ dashboard_layout = html.Div([
|
|
91 |
html.Div(
|
92 |
[
|
93 |
html.H3('Energy Consumption'),
|
94 |
-
dcc.Graph(id='energy-
|
95 |
], className='six columns'
|
96 |
-
)
|
97 |
-
|
|
|
98 |
html.Div(
|
99 |
[
|
100 |
html.Div(
|
101 |
[
|
102 |
-
html.H3('
|
103 |
-
dcc.Graph(id='
|
104 |
], className='six columns'
|
105 |
)
|
106 |
], className='row'),
|
107 |
],
|
108 |
#add background image from local file and make it transparent
|
109 |
#, style={'background-image':'url(/assets/background_1.png)'}
|
110 |
-
style={'background-color': '#
|
111 |
)
|
112 |
|
113 |
|
114 |
-
|
115 |
wiki_layout = html.Div([
|
116 |
dcc.Link('Dashboard', href='/'),
|
117 |
|
@@ -119,11 +172,11 @@ wiki_layout = html.Div([
|
|
119 |
|
120 |
html.Div([
|
121 |
html.Div([
|
122 |
-
|
123 |
html.H3('What is this project about?'),
|
124 |
|
125 |
html.P('This project is a simulation of a shower system. The goal is to find the best policy for the boiler to heat the water for the shower. The policy is a function that takes the current hour of the day and the current temperature of the water in the boiler and returns the temperature that the boiler should heat the water to.'),
|
126 |
-
html.P('The best policy is the one that maximizes the
|
127 |
|
128 |
html.H3('How does it work?'),
|
129 |
|
@@ -151,7 +204,7 @@ wiki_layout = html.Div([
|
|
151 |
|
152 |
], className='six columns'),], className='row'),
|
153 |
],
|
154 |
-
style={'background-color': '#
|
155 |
|
156 |
)
|
157 |
|
@@ -167,20 +220,43 @@ def display_page(pathname):
|
|
167 |
# You could also return a 404 "URL not found" page here
|
168 |
|
169 |
|
170 |
-
|
171 |
@app.callback(
|
172 |
Output('policy_readable-graph', 'figure'),
|
173 |
-
Output('energy-
|
174 |
-
Output('
|
|
|
175 |
Output('solution-status', 'children'),
|
|
|
176 |
Input('solution-dropdown', 'value'),
|
177 |
Input('ideal-temperature-slider', 'value')
|
178 |
)
|
179 |
-
def update_graph(solution, ideal_temperature):
|
180 |
energy_consumption = data['energy_consumption'].values
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
policy_readable_graph = px.line(data, x='hour', y='policy_readable',
|
185 |
labels={'hour': 'Hour', 'policy_readable': 'Policy'},
|
186 |
color_discrete_sequence=['lightgreen'])
|
@@ -190,8 +266,10 @@ def update_graph(solution, ideal_temperature):
|
|
190 |
legend_title="Policy"
|
191 |
)
|
192 |
|
193 |
-
|
194 |
-
|
|
|
|
|
195 |
labels={'hour': 'Hour', 'energy_consumption': 'Energy Consumption (kWh)'},
|
196 |
color_discrete_sequence=['lightgreen'])
|
197 |
energy_consumption_graph.update_layout(
|
@@ -201,28 +279,31 @@ def update_graph(solution, ideal_temperature):
|
|
201 |
)
|
202 |
#add accumulated energy consumption
|
203 |
energy_consumption = np.cumsum(energy_consumption)
|
204 |
-
energy_consumption_graph.add_trace(px.line(data, x='hour',
|
205 |
y=energy_consumption,
|
206 |
labels={'y': 'Acc. Energy Consumption (kWh)'},
|
207 |
color_discrete_sequence=['green']).data[0])
|
208 |
|
209 |
-
|
210 |
-
|
|
|
|
|
211 |
color_discrete_sequence=['lightgreen'])
|
212 |
|
213 |
-
|
214 |
xaxis_title="Hour",
|
215 |
-
yaxis_title="
|
216 |
-
legend_title="
|
217 |
)
|
218 |
-
#add accumulated
|
219 |
-
|
220 |
-
|
221 |
-
labels={'y': 'Acc.
|
222 |
color_discrete_sequence=['green']
|
223 |
).data[0])
|
224 |
result = "No solution found"
|
225 |
-
return policy_readable_graph, energy_consumption_graph,
|
226 |
-
if __name__ == "__main__":
|
227 |
-
app.run_server(host="0.0.0.0", port="8050", debug=debug)
|
228 |
|
|
|
|
|
|
|
|
8 |
import example_data
|
9 |
import core
|
10 |
|
|
|
11 |
outside_temp = example_data.ExampleDailyOutsideTemperature
|
12 |
energy_price = example_data.ExampleDailyEnergyCost
|
13 |
boiler_temperature = example_data.ExampleBoilerTemperature
|
14 |
|
15 |
+
data = pd.DataFrame(columns=['hour', 'energy_consumption', 'comfort', 'policy_readable'])
|
16 |
+
data = pd.concat([data, pd.DataFrame({'hour': np.arange(0, 24), 'energy_consumption': energy_price.value, 'comfort': np.random.rand(24),
|
|
|
|
|
17 |
'policy_readable': np.random.choice(['A', 'B', 'C', 'D', 'E'], 24)
|
18 |
})])
|
19 |
debug = False
|
20 |
|
|
|
21 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
|
22 |
|
23 |
app = Dash(__name__, external_stylesheets=external_stylesheets)
|
|
|
29 |
|
30 |
server = app.server
|
31 |
|
32 |
+
# Solution options
|
|
|
33 |
solution_options = [
|
34 |
"Discrete Optimization",
|
35 |
"Continuous Optimization",
|
|
|
37 |
]
|
38 |
solution_options_default_value = solution_options[0]
|
39 |
|
40 |
+
# Datasets
|
41 |
+
dataset_options = [
|
42 |
+
"16NSJNnjLK4MndjZYaKYGKEV",
|
43 |
+
"7uLwefnSt8CgVlmIGY8emqJK",
|
44 |
+
"8yS04Ddkk3pPL8e9Rku4LJtc",
|
45 |
+
"Cwp33jA19hp9VdoNJUlj6USf",
|
46 |
+
"iBFIAuvh7bCNyOQDo0jkjhRV",
|
47 |
+
"iNVKpGfGW6rU17eOtxpZSFWR",
|
48 |
+
"kaTMmHVh8gXUbHMppzdmdzpv",
|
49 |
+
"KN9Z3gANLftDuUGvgs8O38dI",
|
50 |
+
"LzbMafI31IosheUI7YGhj5at",
|
51 |
+
"PHqaZDuMTRvCZCvA259Z1vJu",
|
52 |
+
"RZngVU6axOdshmfma0yNAajE",
|
53 |
+
"SQUOjMB6zAgYpSJEMy46tKXJ",
|
54 |
+
"UcufQVoJQPbfLzIBnSsUodJP",
|
55 |
+
"VTuh8oxtC6YlOCLeScXfLuY3",
|
56 |
+
"VZTnyVO3TP3ILuYsN5Xw9UR0",
|
57 |
+
"WyPRjcmBXJZoC9DIURMXKxn8",
|
58 |
+
"yPtlbyLlDlzeBZQYrPYaByoB",
|
59 |
+
]
|
60 |
+
dataset_options_default_value = dataset_options[0]
|
61 |
+
dataset_dfs = {
|
62 |
+
"16NSJNnjLK4MndjZYaKYGKEV": pd.read_csv('data/16NSJNnjLK4MndjZYaKYGKEV.csv')[:100000],
|
63 |
+
"7uLwefnSt8CgVlmIGY8emqJK": pd.read_csv('data/7uLwefnSt8CgVlmIGY8emqJK.csv')[:100000],
|
64 |
+
"8yS04Ddkk3pPL8e9Rku4LJtc": pd.read_csv('data/8yS04Ddkk3pPL8e9Rku4LJtc.csv')[:100000],
|
65 |
+
"Cwp33jA19hp9VdoNJUlj6USf": pd.read_csv('data/Cwp33jA19hp9VdoNJUlj6USf.csv')[:100000],
|
66 |
+
"iBFIAuvh7bCNyOQDo0jkjhRV": pd.read_csv('data/iBFIAuvh7bCNyOQDo0jkjhRV.csv')[:100000],
|
67 |
+
"iNVKpGfGW6rU17eOtxpZSFWR": pd.read_csv('data/iNVKpGfGW6rU17eOtxpZSFWR.csv')[:100000],
|
68 |
+
"kaTMmHVh8gXUbHMppzdmdzpv": pd.read_csv('data/kaTMmHVh8gXUbHMppzdmdzpv.csv')[:100000],
|
69 |
+
"KN9Z3gANLftDuUGvgs8O38dI": pd.read_csv('data/KN9Z3gANLftDuUGvgs8O38dI.csv')[:100000],
|
70 |
+
"LzbMafI31IosheUI7YGhj5at": pd.read_csv('data/LzbMafI31IosheUI7YGhj5at.csv')[:100000],
|
71 |
+
"PHqaZDuMTRvCZCvA259Z1vJu": pd.read_csv('data/PHqaZDuMTRvCZCvA259Z1vJu.csv')[:100000],
|
72 |
+
"RZngVU6axOdshmfma0yNAajE": pd.read_csv('data/RZngVU6axOdshmfma0yNAajE.csv')[:100000],
|
73 |
+
"SQUOjMB6zAgYpSJEMy46tKXJ": pd.read_csv('data/SQUOjMB6zAgYpSJEMy46tKXJ.csv')[:100000],
|
74 |
+
"UcufQVoJQPbfLzIBnSsUodJP": pd.read_csv('data/UcufQVoJQPbfLzIBnSsUodJP.csv')[:100000],
|
75 |
+
"VTuh8oxtC6YlOCLeScXfLuY3": pd.read_csv('data/VTuh8oxtC6YlOCLeScXfLuY3.csv')[:100000],
|
76 |
+
"VZTnyVO3TP3ILuYsN5Xw9UR0": pd.read_csv('data/VZTnyVO3TP3ILuYsN5Xw9UR0.csv')[:100000],
|
77 |
+
"WyPRjcmBXJZoC9DIURMXKxn8": pd.read_csv('data/WyPRjcmBXJZoC9DIURMXKxn8.csv')[:100000],
|
78 |
+
"yPtlbyLlDlzeBZQYrPYaByoB": pd.read_csv('data/yPtlbyLlDlzeBZQYrPYaByoB.csv')[:100000],
|
79 |
+
}
|
80 |
+
|
81 |
# provide a scalar value to enable the slider to select ideal temperature
|
82 |
ideal_temperature = 50
|
83 |
|
|
|
88 |
#small subtitle that says of solution is possible or not
|
89 |
html.Div(id='solution-status', children='', style={'color': 'lighrgrey'}),
|
90 |
html.Div([
|
91 |
+
html.Div([
|
92 |
+
html.H3('Dataset'),
|
93 |
+
dcc.Dropdown(
|
94 |
+
id='dataset-dropdown',
|
95 |
+
options=dataset_options,
|
96 |
+
value=dataset_options_default_value,
|
97 |
+
)
|
98 |
+
], className='three columns'),
|
99 |
html.Div([
|
100 |
html.H3('Solution'),
|
101 |
dcc.Dropdown(
|
|
|
123 |
], className='three columns'),
|
124 |
|
125 |
|
126 |
+
], className='row'),
|
127 |
+
html.Div(
|
128 |
+
[
|
129 |
+
html.Div(
|
130 |
+
[
|
131 |
+
html.H3('Dataset'),
|
132 |
+
dcc.Graph(id='dataset-graph')
|
133 |
+
], className='twelve columns',
|
134 |
+
)
|
135 |
], className='row'),
|
136 |
html.Div(
|
137 |
[
|
|
|
144 |
html.Div(
|
145 |
[
|
146 |
html.H3('Energy Consumption'),
|
147 |
+
dcc.Graph(id='energy-consumption-graph')
|
148 |
], className='six columns'
|
149 |
+
),
|
150 |
+
]
|
151 |
+
),
|
152 |
html.Div(
|
153 |
[
|
154 |
html.Div(
|
155 |
[
|
156 |
+
html.H3('Comfort'),
|
157 |
+
dcc.Graph(id='comfort-graph')
|
158 |
], className='six columns'
|
159 |
)
|
160 |
], className='row'),
|
161 |
],
|
162 |
#add background image from local file and make it transparent
|
163 |
#, style={'background-image':'url(/assets/background_1.png)'}
|
164 |
+
style={'background-color': '#333', 'font-family': 'Fantasy', 'color': '#999', 'padding': '10px'}
|
165 |
)
|
166 |
|
167 |
|
|
|
168 |
wiki_layout = html.Div([
|
169 |
dcc.Link('Dashboard', href='/'),
|
170 |
|
|
|
172 |
|
173 |
html.Div([
|
174 |
html.Div([
|
175 |
+
|
176 |
html.H3('What is this project about?'),
|
177 |
|
178 |
html.P('This project is a simulation of a shower system. The goal is to find the best policy for the boiler to heat the water for the shower. The policy is a function that takes the current hour of the day and the current temperature of the water in the boiler and returns the temperature that the boiler should heat the water to.'),
|
179 |
+
html.P('The best policy is the one that maximizes the comfort of the shower and minimizes the energy consumption of the boiler.'),
|
180 |
|
181 |
html.H3('How does it work?'),
|
182 |
|
|
|
204 |
|
205 |
], className='six columns'),], className='row'),
|
206 |
],
|
207 |
+
style={'background-color': '#333', 'font-family': 'Fantasy', 'color': '#999', 'padding': '10px'}
|
208 |
|
209 |
)
|
210 |
|
|
|
220 |
# You could also return a 404 "URL not found" page here
|
221 |
|
222 |
|
|
|
223 |
@app.callback(
|
224 |
Output('policy_readable-graph', 'figure'),
|
225 |
+
Output('energy-consumption-graph', 'figure'),
|
226 |
+
Output('comfort-graph', 'figure'),
|
227 |
+
Output('dataset-graph', 'figure'),
|
228 |
Output('solution-status', 'children'),
|
229 |
+
Input('dataset-dropdown', 'value'),
|
230 |
Input('solution-dropdown', 'value'),
|
231 |
Input('ideal-temperature-slider', 'value')
|
232 |
)
|
233 |
+
def update_graph(dataset, solution, ideal_temperature):
|
234 |
energy_consumption = data['energy_consumption'].values
|
235 |
+
comfort_obtained = data['comfort'].values
|
236 |
+
|
237 |
+
|
238 |
+
# Dataset Graph
|
239 |
+
dataset_df = dataset_dfs[dataset]
|
240 |
+
dataset_df['ChActive'] = dataset_df['ChActive'].map({'Yes': 90, 'No': 5})
|
241 |
+
dataset_df['HwActive'] = dataset_df['HwActive'].map({'Yes': 100, 'No': 0})
|
242 |
|
243 |
+
dataset_graph = px.line()
|
244 |
+
#Add another line to the plot
|
245 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['ActPow'], mode='lines', name='ActPow')
|
246 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwActive'], mode='lines', name='HwActive')
|
247 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['ChActive'], mode='lines', name='ChActive')
|
248 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTSet'], mode='lines', name='HwTSet')
|
249 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['DHW_E21_T3_START_TEMP'], mode='lines', name='START_TEMP')
|
250 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTStor'], mode='lines', name='HwTStor')
|
251 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTAct'], mode='lines', name='HwTAct')
|
252 |
+
dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['OutTemp'], mode='lines', name='OutTemp')
|
253 |
|
254 |
+
start_time = pd.Timestamp(dataset_df['ts'][0])
|
255 |
+
|
256 |
+
dataset_graph.update_xaxes(range=[start_time, start_time+pd.Timedelta(days=2)])
|
257 |
+
|
258 |
+
|
259 |
+
# Policy Graph
|
260 |
policy_readable_graph = px.line(data, x='hour', y='policy_readable',
|
261 |
labels={'hour': 'Hour', 'policy_readable': 'Policy'},
|
262 |
color_discrete_sequence=['lightgreen'])
|
|
|
266 |
legend_title="Policy"
|
267 |
)
|
268 |
|
269 |
+
|
270 |
+
# Energy Consumption Graph
|
271 |
+
energy_consumption_graph = px.line(data, x='hour',
|
272 |
+
y='energy_consumption',
|
273 |
labels={'hour': 'Hour', 'energy_consumption': 'Energy Consumption (kWh)'},
|
274 |
color_discrete_sequence=['lightgreen'])
|
275 |
energy_consumption_graph.update_layout(
|
|
|
279 |
)
|
280 |
#add accumulated energy consumption
|
281 |
energy_consumption = np.cumsum(energy_consumption)
|
282 |
+
energy_consumption_graph.add_trace(px.line(data, x='hour',
|
283 |
y=energy_consumption,
|
284 |
labels={'y': 'Acc. Energy Consumption (kWh)'},
|
285 |
color_discrete_sequence=['green']).data[0])
|
286 |
|
287 |
+
|
288 |
+
# Comfort Graph
|
289 |
+
comfort_graph = px.line(data, x='hour', y='comfort',
|
290 |
+
labels={'hour': 'Hour', 'comfort': 'comfort Score'},
|
291 |
color_discrete_sequence=['lightgreen'])
|
292 |
|
293 |
+
comfort_graph.update_layout(
|
294 |
xaxis_title="Hour",
|
295 |
+
yaxis_title="comfort Score",
|
296 |
+
legend_title="comfort"
|
297 |
)
|
298 |
+
#add accumulated comfort
|
299 |
+
comfort_obtained = np.cumsum(comfort_obtained)
|
300 |
+
comfort_graph.add_trace(px.line(data, x='hour', y=comfort_obtained,
|
301 |
+
labels={'y': 'Acc. comfort Score'},
|
302 |
color_discrete_sequence=['green']
|
303 |
).data[0])
|
304 |
result = "No solution found"
|
305 |
+
return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, result
|
|
|
|
|
306 |
|
307 |
+
|
308 |
+
if __name__ == "__main__":
|
309 |
+
app.run_server(host="0.0.0.0", port="8050", debug=debug)
|
app/dashboard.ipynb
CHANGED
@@ -2,41 +2,9 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
-
"outputs": [
|
8 |
-
{
|
9 |
-
"name": "stderr",
|
10 |
-
"output_type": "stream",
|
11 |
-
"text": [
|
12 |
-
"/var/folders/b4/lwfgccm95kqd2skcwvrt2fr00000gn/T/ipykernel_7355/1062829466.py:19: FutureWarning:\n",
|
13 |
-
"\n",
|
14 |
-
"The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
|
15 |
-
"\n"
|
16 |
-
]
|
17 |
-
},
|
18 |
-
{
|
19 |
-
"data": {
|
20 |
-
"text/html": [
|
21 |
-
"\n",
|
22 |
-
" <iframe\n",
|
23 |
-
" width=\"100%\"\n",
|
24 |
-
" height=\"650\"\n",
|
25 |
-
" src=\"http://0.0.0.0:8050/\"\n",
|
26 |
-
" frameborder=\"0\"\n",
|
27 |
-
" allowfullscreen\n",
|
28 |
-
" \n",
|
29 |
-
" ></iframe>\n",
|
30 |
-
" "
|
31 |
-
],
|
32 |
-
"text/plain": [
|
33 |
-
"<IPython.lib.display.IFrame at 0x28c80a4d0>"
|
34 |
-
]
|
35 |
-
},
|
36 |
-
"metadata": {},
|
37 |
-
"output_type": "display_data"
|
38 |
-
}
|
39 |
-
],
|
40 |
"source": [
|
41 |
"import os\n",
|
42 |
"import plotly.express as px\n",
|
@@ -48,20 +16,16 @@
|
|
48 |
"import example_data\n",
|
49 |
"import core\n",
|
50 |
"\n",
|
51 |
-
"\n",
|
52 |
"outside_temp = example_data.ExampleDailyOutsideTemperature\n",
|
53 |
"energy_price = example_data.ExampleDailyEnergyCost\n",
|
54 |
"boiler_temperature = example_data.ExampleBoilerTemperature\n",
|
55 |
"\n",
|
56 |
-
"\n",
|
57 |
-
"
|
58 |
-
"data = pd.DataFrame(columns=['hour', 'energy_consumption', 'confort', 'policy_readable'])\n",
|
59 |
-
"data = pd.concat([data, pd.DataFrame({'hour': np.arange(0, 24), 'energy_consumption': energy_price.value, 'confort': np.random.rand(24),\n",
|
60 |
" 'policy_readable': np.random.choice(['A', 'B', 'C', 'D', 'E'], 24)\n",
|
61 |
" })])\n",
|
62 |
"debug = False\n",
|
63 |
"\n",
|
64 |
-
"\n",
|
65 |
"external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n",
|
66 |
"\n",
|
67 |
"app = Dash(__name__, external_stylesheets=external_stylesheets)\n",
|
@@ -73,8 +37,7 @@
|
|
73 |
"\n",
|
74 |
"server = app.server\n",
|
75 |
"\n",
|
76 |
-
"\n",
|
77 |
-
"# SOlution options\n",
|
78 |
"solution_options = [\n",
|
79 |
" \"Discrete Optimization\",\n",
|
80 |
" \"Continuous Optimization\",\n",
|
@@ -82,6 +45,47 @@
|
|
82 |
"]\n",
|
83 |
"solution_options_default_value = solution_options[0]\n",
|
84 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
"# provide a scalar value to enable the slider to select ideal temperature\n",
|
86 |
"ideal_temperature = 50\n",
|
87 |
"\n",
|
@@ -93,6 +97,14 @@
|
|
93 |
" html.Div(id='solution-status', children='', style={'color': 'lighrgrey'}),\n",
|
94 |
" html.Div([\n",
|
95 |
" html.Div([\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
" html.H3('Solution'),\n",
|
97 |
" dcc.Dropdown(\n",
|
98 |
" id='solution-dropdown',\n",
|
@@ -124,6 +136,15 @@
|
|
124 |
" [\n",
|
125 |
" html.Div(\n",
|
126 |
" [\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
" html.H3('Policy'),\n",
|
128 |
" dcc.Graph(id='policy_readable-graph')\n",
|
129 |
" ], className='six columns',\n",
|
@@ -131,27 +152,27 @@
|
|
131 |
" html.Div(\n",
|
132 |
" [\n",
|
133 |
" html.H3('Energy Consumption'),\n",
|
134 |
-
" dcc.Graph(id='energy-
|
135 |
" ], className='six columns'\n",
|
136 |
-
" )
|
137 |
-
"
|
|
|
138 |
" html.Div(\n",
|
139 |
" [\n",
|
140 |
" html.Div(\n",
|
141 |
" [\n",
|
142 |
-
" html.H3('
|
143 |
-
" dcc.Graph(id='
|
144 |
" ], className='six columns'\n",
|
145 |
" )\n",
|
146 |
" ], className='row'),\n",
|
147 |
"],\n",
|
148 |
"#add background image from local file and make it transparent\n",
|
149 |
"#, style={'background-image':'url(/assets/background_1.png)'}\n",
|
150 |
-
"style={'background-color': '#
|
151 |
")\n",
|
152 |
"\n",
|
153 |
"\n",
|
154 |
-
"\n",
|
155 |
"wiki_layout = html.Div([\n",
|
156 |
" dcc.Link('Dashboard', href='/'),\n",
|
157 |
"\n",
|
@@ -163,7 +184,7 @@
|
|
163 |
" html.H3('What is this project about?'),\n",
|
164 |
"\n",
|
165 |
" html.P('This project is a simulation of a shower system. The goal is to find the best policy for the boiler to heat the water for the shower. The policy is a function that takes the current hour of the day and the current temperature of the water in the boiler and returns the temperature that the boiler should heat the water to.'),\n",
|
166 |
-
" html.P('The best policy is the one that maximizes the
|
167 |
"\n",
|
168 |
" html.H3('How does it work?'),\n",
|
169 |
"\n",
|
@@ -191,7 +212,7 @@
|
|
191 |
"\n",
|
192 |
" ], className='six columns'),], className='row'),\n",
|
193 |
"],\n",
|
194 |
-
"style={'background-color': '#
|
195 |
"\n",
|
196 |
")\n",
|
197 |
"\n",
|
@@ -207,20 +228,43 @@
|
|
207 |
" # You could also return a 404 \"URL not found\" page here\n",
|
208 |
"\n",
|
209 |
"\n",
|
210 |
-
"\n",
|
211 |
"@app.callback(\n",
|
212 |
" Output('policy_readable-graph', 'figure'),\n",
|
213 |
-
" Output('energy-
|
214 |
-
" Output('
|
|
|
215 |
" Output('solution-status', 'children'),\n",
|
|
|
216 |
" Input('solution-dropdown', 'value'),\n",
|
217 |
" Input('ideal-temperature-slider', 'value')\n",
|
218 |
")\n",
|
219 |
-
"def update_graph(solution, ideal_temperature):\n",
|
220 |
" energy_consumption = data['energy_consumption'].values\n",
|
221 |
-
"
|
222 |
-
"\n",
|
223 |
-
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
" policy_readable_graph = px.line(data, x='hour', y='policy_readable',\n",
|
225 |
" labels={'hour': 'Hour', 'policy_readable': 'Policy'},\n",
|
226 |
" color_discrete_sequence=['lightgreen'])\n",
|
@@ -230,6 +274,8 @@
|
|
230 |
" legend_title=\"Policy\"\n",
|
231 |
" )\n",
|
232 |
"\n",
|
|
|
|
|
233 |
" energy_consumption_graph = px.line(data, x='hour', \n",
|
234 |
" y='energy_consumption', \n",
|
235 |
" labels={'hour': 'Hour', 'energy_consumption': 'Energy Consumption (kWh)'},\n",
|
@@ -246,26 +292,29 @@
|
|
246 |
" labels={'y': 'Acc. Energy Consumption (kWh)'},\n",
|
247 |
" color_discrete_sequence=['green']).data[0])\n",
|
248 |
"\n",
|
249 |
-
"
|
250 |
-
"
|
|
|
|
|
251 |
" color_discrete_sequence=['lightgreen'])\n",
|
252 |
"\n",
|
253 |
-
"
|
254 |
" xaxis_title=\"Hour\",\n",
|
255 |
-
" yaxis_title=\"
|
256 |
-
" legend_title=\"
|
257 |
" )\n",
|
258 |
-
" #add accumulated
|
259 |
-
"
|
260 |
-
"
|
261 |
-
" labels={'y': 'Acc.
|
262 |
" color_discrete_sequence=['green']\n",
|
263 |
" ).data[0])\n",
|
264 |
" result = \"No solution found\"\n",
|
265 |
-
" return policy_readable_graph, energy_consumption_graph,
|
|
|
|
|
266 |
"if __name__ == \"__main__\":\n",
|
267 |
-
" app.run_server(host=\"
|
268 |
-
"\n"
|
269 |
]
|
270 |
}
|
271 |
],
|
@@ -285,7 +334,7 @@
|
|
285 |
"name": "python",
|
286 |
"nbconvert_exporter": "python",
|
287 |
"pygments_lexer": "ipython3",
|
288 |
-
"version": "3.
|
289 |
},
|
290 |
"orig_nbformat": 4
|
291 |
},
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
"metadata": {},
|
7 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
"source": [
|
9 |
"import os\n",
|
10 |
"import plotly.express as px\n",
|
|
|
16 |
"import example_data\n",
|
17 |
"import core\n",
|
18 |
"\n",
|
|
|
19 |
"outside_temp = example_data.ExampleDailyOutsideTemperature\n",
|
20 |
"energy_price = example_data.ExampleDailyEnergyCost\n",
|
21 |
"boiler_temperature = example_data.ExampleBoilerTemperature\n",
|
22 |
"\n",
|
23 |
+
"data = pd.DataFrame(columns=['hour', 'energy_consumption', 'comfort', 'policy_readable'])\n",
|
24 |
+
"data = pd.concat([data, pd.DataFrame({'hour': np.arange(0, 24), 'energy_consumption': energy_price.value, 'comfort': np.random.rand(24),\n",
|
|
|
|
|
25 |
" 'policy_readable': np.random.choice(['A', 'B', 'C', 'D', 'E'], 24)\n",
|
26 |
" })])\n",
|
27 |
"debug = False\n",
|
28 |
"\n",
|
|
|
29 |
"external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n",
|
30 |
"\n",
|
31 |
"app = Dash(__name__, external_stylesheets=external_stylesheets)\n",
|
|
|
37 |
"\n",
|
38 |
"server = app.server\n",
|
39 |
"\n",
|
40 |
+
"# Solution options\n",
|
|
|
41 |
"solution_options = [\n",
|
42 |
" \"Discrete Optimization\",\n",
|
43 |
" \"Continuous Optimization\",\n",
|
|
|
45 |
"]\n",
|
46 |
"solution_options_default_value = solution_options[0]\n",
|
47 |
"\n",
|
48 |
+
"# Datasets\n",
|
49 |
+
"dataset_options = [\n",
|
50 |
+
" \"16NSJNnjLK4MndjZYaKYGKEV\",\n",
|
51 |
+
" \"7uLwefnSt8CgVlmIGY8emqJK\",\n",
|
52 |
+
" \"8yS04Ddkk3pPL8e9Rku4LJtc\",\n",
|
53 |
+
" \"Cwp33jA19hp9VdoNJUlj6USf\",\n",
|
54 |
+
" \"iBFIAuvh7bCNyOQDo0jkjhRV\",\n",
|
55 |
+
" \"iNVKpGfGW6rU17eOtxpZSFWR\",\n",
|
56 |
+
" \"kaTMmHVh8gXUbHMppzdmdzpv\",\n",
|
57 |
+
" \"KN9Z3gANLftDuUGvgs8O38dI\",\n",
|
58 |
+
" \"LzbMafI31IosheUI7YGhj5at\",\n",
|
59 |
+
" \"PHqaZDuMTRvCZCvA259Z1vJu\",\n",
|
60 |
+
" \"RZngVU6axOdshmfma0yNAajE\",\n",
|
61 |
+
" \"SQUOjMB6zAgYpSJEMy46tKXJ\",\n",
|
62 |
+
" \"UcufQVoJQPbfLzIBnSsUodJP\",\n",
|
63 |
+
" \"VTuh8oxtC6YlOCLeScXfLuY3\",\n",
|
64 |
+
" \"VZTnyVO3TP3ILuYsN5Xw9UR0\",\n",
|
65 |
+
" \"WyPRjcmBXJZoC9DIURMXKxn8\",\n",
|
66 |
+
" \"yPtlbyLlDlzeBZQYrPYaByoB\",\n",
|
67 |
+
"]\n",
|
68 |
+
"dataset_options_default_value = dataset_options[0]\n",
|
69 |
+
"dataset_dfs = {\n",
|
70 |
+
" \"16NSJNnjLK4MndjZYaKYGKEV\": pd.read_csv('data/16NSJNnjLK4MndjZYaKYGKEV.csv')[:100000],\n",
|
71 |
+
" \"7uLwefnSt8CgVlmIGY8emqJK\": pd.read_csv('data/7uLwefnSt8CgVlmIGY8emqJK.csv')[:100000],\n",
|
72 |
+
" \"8yS04Ddkk3pPL8e9Rku4LJtc\": pd.read_csv('data/8yS04Ddkk3pPL8e9Rku4LJtc.csv')[:100000],\n",
|
73 |
+
" \"Cwp33jA19hp9VdoNJUlj6USf\": pd.read_csv('data/Cwp33jA19hp9VdoNJUlj6USf.csv')[:100000],\n",
|
74 |
+
" \"iBFIAuvh7bCNyOQDo0jkjhRV\": pd.read_csv('data/iBFIAuvh7bCNyOQDo0jkjhRV.csv')[:100000],\n",
|
75 |
+
" \"iNVKpGfGW6rU17eOtxpZSFWR\": pd.read_csv('data/iNVKpGfGW6rU17eOtxpZSFWR.csv')[:100000],\n",
|
76 |
+
" \"kaTMmHVh8gXUbHMppzdmdzpv\": pd.read_csv('data/kaTMmHVh8gXUbHMppzdmdzpv.csv')[:100000],\n",
|
77 |
+
" \"KN9Z3gANLftDuUGvgs8O38dI\": pd.read_csv('data/KN9Z3gANLftDuUGvgs8O38dI.csv')[:100000],\n",
|
78 |
+
" \"LzbMafI31IosheUI7YGhj5at\": pd.read_csv('data/LzbMafI31IosheUI7YGhj5at.csv')[:100000],\n",
|
79 |
+
" \"PHqaZDuMTRvCZCvA259Z1vJu\": pd.read_csv('data/PHqaZDuMTRvCZCvA259Z1vJu.csv')[:100000],\n",
|
80 |
+
" \"RZngVU6axOdshmfma0yNAajE\": pd.read_csv('data/RZngVU6axOdshmfma0yNAajE.csv')[:100000],\n",
|
81 |
+
" \"SQUOjMB6zAgYpSJEMy46tKXJ\": pd.read_csv('data/SQUOjMB6zAgYpSJEMy46tKXJ.csv')[:100000],\n",
|
82 |
+
" \"UcufQVoJQPbfLzIBnSsUodJP\": pd.read_csv('data/UcufQVoJQPbfLzIBnSsUodJP.csv')[:100000],\n",
|
83 |
+
" \"VTuh8oxtC6YlOCLeScXfLuY3\": pd.read_csv('data/VTuh8oxtC6YlOCLeScXfLuY3.csv')[:100000],\n",
|
84 |
+
" \"VZTnyVO3TP3ILuYsN5Xw9UR0\": pd.read_csv('data/VZTnyVO3TP3ILuYsN5Xw9UR0.csv')[:100000],\n",
|
85 |
+
" \"WyPRjcmBXJZoC9DIURMXKxn8\": pd.read_csv('data/WyPRjcmBXJZoC9DIURMXKxn8.csv')[:100000],\n",
|
86 |
+
" \"yPtlbyLlDlzeBZQYrPYaByoB\": pd.read_csv('data/yPtlbyLlDlzeBZQYrPYaByoB.csv')[:100000],\n",
|
87 |
+
"}\n",
|
88 |
+
"\n",
|
89 |
"# provide a scalar value to enable the slider to select ideal temperature\n",
|
90 |
"ideal_temperature = 50\n",
|
91 |
"\n",
|
|
|
97 |
" html.Div(id='solution-status', children='', style={'color': 'lighrgrey'}),\n",
|
98 |
" html.Div([\n",
|
99 |
" html.Div([\n",
|
100 |
+
" html.H3('Dataset'),\n",
|
101 |
+
" dcc.Dropdown(\n",
|
102 |
+
" id='dataset-dropdown',\n",
|
103 |
+
" options=dataset_options,\n",
|
104 |
+
" value=dataset_options_default_value,\n",
|
105 |
+
" )\n",
|
106 |
+
" ], className='three columns'),\n",
|
107 |
+
" html.Div([\n",
|
108 |
" html.H3('Solution'),\n",
|
109 |
" dcc.Dropdown(\n",
|
110 |
" id='solution-dropdown',\n",
|
|
|
136 |
" [\n",
|
137 |
" html.Div(\n",
|
138 |
" [\n",
|
139 |
+
" html.H3('Dataset'),\n",
|
140 |
+
" dcc.Graph(id='dataset-graph')\n",
|
141 |
+
" ], className='twelve columns',\n",
|
142 |
+
" )\n",
|
143 |
+
" ], className='row'),\n",
|
144 |
+
" html.Div(\n",
|
145 |
+
" [\n",
|
146 |
+
" html.Div(\n",
|
147 |
+
" [\n",
|
148 |
" html.H3('Policy'),\n",
|
149 |
" dcc.Graph(id='policy_readable-graph')\n",
|
150 |
" ], className='six columns',\n",
|
|
|
152 |
" html.Div(\n",
|
153 |
" [\n",
|
154 |
" html.H3('Energy Consumption'),\n",
|
155 |
+
" dcc.Graph(id='energy-consumption-graph')\n",
|
156 |
" ], className='six columns'\n",
|
157 |
+
" ),\n",
|
158 |
+
" ]\n",
|
159 |
+
" ),\n",
|
160 |
" html.Div(\n",
|
161 |
" [\n",
|
162 |
" html.Div(\n",
|
163 |
" [\n",
|
164 |
+
" html.H3('Comfort'),\n",
|
165 |
+
" dcc.Graph(id='comfort-graph')\n",
|
166 |
" ], className='six columns'\n",
|
167 |
" )\n",
|
168 |
" ], className='row'),\n",
|
169 |
"],\n",
|
170 |
"#add background image from local file and make it transparent\n",
|
171 |
"#, style={'background-image':'url(/assets/background_1.png)'}\n",
|
172 |
+
"style={'background-color': '#333', 'font-family': 'Fantasy', 'color': '#999', 'padding': '10px'}\n",
|
173 |
")\n",
|
174 |
"\n",
|
175 |
"\n",
|
|
|
176 |
"wiki_layout = html.Div([\n",
|
177 |
" dcc.Link('Dashboard', href='/'),\n",
|
178 |
"\n",
|
|
|
184 |
" html.H3('What is this project about?'),\n",
|
185 |
"\n",
|
186 |
" html.P('This project is a simulation of a shower system. The goal is to find the best policy for the boiler to heat the water for the shower. The policy is a function that takes the current hour of the day and the current temperature of the water in the boiler and returns the temperature that the boiler should heat the water to.'),\n",
|
187 |
+
" html.P('The best policy is the one that maximizes the comfort of the shower and minimizes the energy consumption of the boiler.'),\n",
|
188 |
"\n",
|
189 |
" html.H3('How does it work?'),\n",
|
190 |
"\n",
|
|
|
212 |
"\n",
|
213 |
" ], className='six columns'),], className='row'),\n",
|
214 |
"],\n",
|
215 |
+
"style={'background-color': '#333', 'font-family': 'Fantasy', 'color': '#999', 'padding': '10px'}\n",
|
216 |
"\n",
|
217 |
")\n",
|
218 |
"\n",
|
|
|
228 |
" # You could also return a 404 \"URL not found\" page here\n",
|
229 |
"\n",
|
230 |
"\n",
|
|
|
231 |
"@app.callback(\n",
|
232 |
" Output('policy_readable-graph', 'figure'),\n",
|
233 |
+
" Output('energy-consumption-graph', 'figure'),\n",
|
234 |
+
" Output('comfort-graph', 'figure'),\n",
|
235 |
+
" Output('dataset-graph', 'figure'),\n",
|
236 |
" Output('solution-status', 'children'),\n",
|
237 |
+
" Input('dataset-dropdown', 'value'),\n",
|
238 |
" Input('solution-dropdown', 'value'),\n",
|
239 |
" Input('ideal-temperature-slider', 'value')\n",
|
240 |
")\n",
|
241 |
+
"def update_graph(dataset, solution, ideal_temperature):\n",
|
242 |
" energy_consumption = data['energy_consumption'].values\n",
|
243 |
+
" comfort_obtained = data['comfort'].values\n",
|
244 |
+
"\n",
|
245 |
+
"\n",
|
246 |
+
" # Dataset Graph\n",
|
247 |
+
" dataset_df = dataset_dfs[dataset]\n",
|
248 |
+
" dataset_df['ChActive'] = dataset_df['ChActive'].map({'Yes': 90, 'No': 5})\n",
|
249 |
+
" dataset_df['HwActive'] = dataset_df['HwActive'].map({'Yes': 100, 'No': 0})\n",
|
250 |
+
"\n",
|
251 |
+
" dataset_graph = px.line()\n",
|
252 |
+
" #Add another line to the plot\n",
|
253 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['ActPow'], mode='lines', name='ActPow')\n",
|
254 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwActive'], mode='lines', name='HwActive')\n",
|
255 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['ChActive'], mode='lines', name='ChActive')\n",
|
256 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTSet'], mode='lines', name='HwTSet')\n",
|
257 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['DHW_E21_T3_START_TEMP'], mode='lines', name='START_TEMP')\n",
|
258 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTStor'], mode='lines', name='HwTStor')\n",
|
259 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['HwTAct'], mode='lines', name='HwTAct')\n",
|
260 |
+
" dataset_graph.add_scatter(x=dataset_df['ts'], y=dataset_df['OutTemp'], mode='lines', name='OutTemp')\n",
|
261 |
+
" \n",
|
262 |
+
" start_time = pd.Timestamp(dataset_df['ts'][0])\n",
|
263 |
+
" \n",
|
264 |
+
" dataset_graph.update_xaxes(range=[start_time, start_time+pd.Timedelta(days=2)])\n",
|
265 |
+
"\n",
|
266 |
+
"\n",
|
267 |
+
" # Policy Graph\n",
|
268 |
" policy_readable_graph = px.line(data, x='hour', y='policy_readable',\n",
|
269 |
" labels={'hour': 'Hour', 'policy_readable': 'Policy'},\n",
|
270 |
" color_discrete_sequence=['lightgreen'])\n",
|
|
|
274 |
" legend_title=\"Policy\"\n",
|
275 |
" )\n",
|
276 |
"\n",
|
277 |
+
"\n",
|
278 |
+
" # Energy Consumption Graph\n",
|
279 |
" energy_consumption_graph = px.line(data, x='hour', \n",
|
280 |
" y='energy_consumption', \n",
|
281 |
" labels={'hour': 'Hour', 'energy_consumption': 'Energy Consumption (kWh)'},\n",
|
|
|
292 |
" labels={'y': 'Acc. Energy Consumption (kWh)'},\n",
|
293 |
" color_discrete_sequence=['green']).data[0])\n",
|
294 |
"\n",
|
295 |
+
"\n",
|
296 |
+
" # Comfort Graph\n",
|
297 |
+
" comfort_graph = px.line(data, x='hour', y='comfort',\n",
|
298 |
+
" labels={'hour': 'Hour', 'comfort': 'comfort Score'},\n",
|
299 |
" color_discrete_sequence=['lightgreen'])\n",
|
300 |
"\n",
|
301 |
+
" comfort_graph.update_layout(\n",
|
302 |
" xaxis_title=\"Hour\",\n",
|
303 |
+
" yaxis_title=\"comfort Score\",\n",
|
304 |
+
" legend_title=\"comfort\"\n",
|
305 |
" )\n",
|
306 |
+
" #add accumulated comfort\n",
|
307 |
+
" comfort_obtained = np.cumsum(comfort_obtained)\n",
|
308 |
+
" comfort_graph.add_trace(px.line(data, x='hour', y=comfort_obtained,\n",
|
309 |
+
" labels={'y': 'Acc. comfort Score'},\n",
|
310 |
" color_discrete_sequence=['green']\n",
|
311 |
" ).data[0])\n",
|
312 |
" result = \"No solution found\"\n",
|
313 |
+
" return policy_readable_graph, energy_consumption_graph, comfort_graph, dataset_graph, result\n",
|
314 |
+
"\n",
|
315 |
+
"\n",
|
316 |
"if __name__ == \"__main__\":\n",
|
317 |
+
" app.run_server(host=\"127.0.0.1\", port=\"8050\", debug=debug)\n"
|
|
|
318 |
]
|
319 |
}
|
320 |
],
|
|
|
334 |
"name": "python",
|
335 |
"nbconvert_exporter": "python",
|
336 |
"pygments_lexer": "ipython3",
|
337 |
+
"version": "3.11.2"
|
338 |
},
|
339 |
"orig_nbformat": 4
|
340 |
},
|
app/data/16NSJNnjLK4MndjZYaKYGKEV.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e25961c50a9a31e7d235caed9708fed102a16d4a472bd0e1fc58627dd790de4
|
3 |
+
size 11961711
|
app/data/7uLwefnSt8CgVlmIGY8emqJK.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:659ddb4c12f7de91a192bad2a18e99cc333c76f4e29a3d2e4830690291fff3a1
|
3 |
+
size 12071661
|
app/data/8yS04Ddkk3pPL8e9Rku4LJtc.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3a47e831f3bbfaca751e141d20da55b04ccd9721246d373a7ef050bb67b87565
|
3 |
+
size 12190338
|
app/data/Cwp33jA19hp9VdoNJUlj6USf.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f01ae9b8242d5bc12f2d3bd222585ed0036305da9180e72e0a8e5b8f246b237
|
3 |
+
size 11359717
|
app/data/KN9Z3gANLftDuUGvgs8O38dI.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d873d98aa37067f045a8cef132772dcb224401cc67104ecc386413e0448547e
|
3 |
+
size 11703710
|
app/data/LzbMafI31IosheUI7YGhj5at.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1193b6e880b401462e848e2fb50a02dd7252c53d26081d0bd0aaf89c7f08f99c
|
3 |
+
size 12113033
|
app/data/PHqaZDuMTRvCZCvA259Z1vJu.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e3ad06aaa9af4ef52db44ca772df1d2c8cae36d327e70bbab803ed9498e97809
|
3 |
+
size 12079447
|
app/data/RZngVU6axOdshmfma0yNAajE.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d1018a448fdbdc4c34ea5359ea4bd84356cd72a95ca2d9af63012b25fc9f1cfa
|
3 |
+
size 12380676
|
app/data/SQUOjMB6zAgYpSJEMy46tKXJ.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd31900cba8111b7bf99fa41af9d036fc46224e6f10d43a563b123033664b7c8
|
3 |
+
size 11957250
|
app/data/UcufQVoJQPbfLzIBnSsUodJP.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95715e28a3c42c8681fd0510e50f95a68830d3d788923fdd32e5bcc180402816
|
3 |
+
size 12493840
|
app/data/VTuh8oxtC6YlOCLeScXfLuY3.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bce301c9c99b36ba4afe247a7cc93fd20071bd9e0fe2bfe0967d105b524de681
|
3 |
+
size 11698681
|
app/data/VZTnyVO3TP3ILuYsN5Xw9UR0.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a94f2e2cfdbac3804c9b3fee8467be166edf68ccab447114735011cd0c7b5e56
|
3 |
+
size 12474901
|
app/data/WyPRjcmBXJZoC9DIURMXKxn8.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6b548e815f656fa34f660c90d93c150cc5ffa8531b12cf01e8907c0b9c83490c
|
3 |
+
size 11290978
|
app/data/iBFIAuvh7bCNyOQDo0jkjhRV.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da5dcc87775e5008e74c252689698b38c0fbe08082e408d17818bbb69411bc40
|
3 |
+
size 12134761
|
app/data/iNVKpGfGW6rU17eOtxpZSFWR.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:547df2c3610a0acded67a7c84730197160b1c4ed31f534f8356b7666d3779356
|
3 |
+
size 12119364
|
app/data/kaTMmHVh8gXUbHMppzdmdzpv.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d597e23e785455aee876e09a9fe5111ac6640aebe7e9b1128603befbadfb5f82
|
3 |
+
size 12527755
|
app/data/yPtlbyLlDlzeBZQYrPYaByoB.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8c4ce91c7f791bc315773f91ccba4b0a38eeeceab87c83351641ede6261a2a8e
|
3 |
+
size 11395071
|