Spaces:
Sleeping
Sleeping
Daniel Varga commited on
Commit ·
9c39ff0
1
Parent(s): 6f8bbb1
dummy prediction yet
Browse files- v2/architecture.py +7 -3
v2/architecture.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import numpy as np
|
| 2 |
import pandas as pd
|
| 3 |
import copy
|
|
|
|
| 4 |
from enum import IntEnum
|
| 5 |
|
| 6 |
# it's really just a network pricing model
|
|
@@ -107,7 +108,7 @@ class Decider:
|
|
| 107 |
# assert len(prod_pred) == len(cons_pred) == self.input_window_size
|
| 108 |
self.random_seed += 1
|
| 109 |
self.random_seed %= 3 # dummy rotates between Decisions
|
| 110 |
-
self.random_seed = Decision.
|
| 111 |
return self.random_seed
|
| 112 |
# dummy decider always says DISCHARGE:
|
| 113 |
# return pd.Series([Decision.DISCHARGE] * self.output_window_size, dtype=int)
|
|
@@ -132,8 +133,8 @@ def simulator(battery_model, supplier, prod_cons, decider):
|
|
| 132 |
|
| 133 |
demand_np = prod_cons['Consumption'].to_numpy()
|
| 134 |
production_np = prod_cons['Production'].to_numpy()
|
| 135 |
-
demand_prediction_np = prod_cons['Consumption_prediction'].to_numpy()
|
| 136 |
-
production_prediction_np = prod_cons['Production_prediction'].to_numpy()
|
| 137 |
assert len(demand_np) == len(production_np)
|
| 138 |
step_in_minutes = prod_cons.index.freq.n
|
| 139 |
assert step_in_minutes == 5
|
|
@@ -262,8 +263,11 @@ def main():
|
|
| 262 |
|
| 263 |
decider = Decider()
|
| 264 |
|
|
|
|
| 265 |
results = simulator(battery_model, supplier, all_data_with_predictions, decider)
|
|
|
|
| 266 |
|
|
|
|
| 267 |
import matplotlib.pyplot as plt
|
| 268 |
results['soc_series'].plot()
|
| 269 |
plt.show()
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import pandas as pd
|
| 3 |
import copy
|
| 4 |
+
import time
|
| 5 |
from enum import IntEnum
|
| 6 |
|
| 7 |
# it's really just a network pricing model
|
|
|
|
| 108 |
# assert len(prod_pred) == len(cons_pred) == self.input_window_size
|
| 109 |
self.random_seed += 1
|
| 110 |
self.random_seed %= 3 # dummy rotates between Decisions
|
| 111 |
+
self.random_seed = Decision.DISCHARGE
|
| 112 |
return self.random_seed
|
| 113 |
# dummy decider always says DISCHARGE:
|
| 114 |
# return pd.Series([Decision.DISCHARGE] * self.output_window_size, dtype=int)
|
|
|
|
| 133 |
|
| 134 |
demand_np = prod_cons['Consumption'].to_numpy()
|
| 135 |
production_np = prod_cons['Production'].to_numpy()
|
| 136 |
+
demand_prediction_np = demand_np # prod_cons['Consumption_prediction'].to_numpy()
|
| 137 |
+
production_prediction_np = production_np # prod_cons['Production_prediction'].to_numpy()
|
| 138 |
assert len(demand_np) == len(production_np)
|
| 139 |
step_in_minutes = prod_cons.index.freq.n
|
| 140 |
assert step_in_minutes == 5
|
|
|
|
| 263 |
|
| 264 |
decider = Decider()
|
| 265 |
|
| 266 |
+
t = time.perf_counter()
|
| 267 |
results = simulator(battery_model, supplier, all_data_with_predictions, decider)
|
| 268 |
+
print("Simulation runtime", time.perf_counter() - t, "seconds.")
|
| 269 |
|
| 270 |
+
return
|
| 271 |
import matplotlib.pyplot as plt
|
| 272 |
results['soc_series'].plot()
|
| 273 |
plt.show()
|