mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-08-25 15:01:14 +00:00
renamed haushaltsgeräte to home appliance (#196)
* * rename Haushaltsgeraete to home appliance * renamed strafe to penalty (optimization problem) Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com> * removed penalty renaming Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com> * renamed one variable Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com> * * renamed variable names and methods of the home appliance class * renamed missed method names * fixed renamed variable * renamed object * adjusted to latest repo changes * renamed file to class_home_applianc.py * renamed method --------- Signed-off-by: Jürgen Eckel <juergen.eckel@gmail.com> Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import pytest
|
||||
|
||||
from akkudoktoreos.config import AppConfig
|
||||
from akkudoktoreos.devices.battery import EAutoParameters, PVAkku, PVAkkuParameters
|
||||
from akkudoktoreos.devices.generic import Haushaltsgeraet, HaushaltsgeraetParameters
|
||||
from akkudoktoreos.devices.generic import HomeAppliance, HomeApplianceParameters
|
||||
from akkudoktoreos.devices.inverter import Wechselrichter, WechselrichterParameters
|
||||
from akkudoktoreos.prediction.ems import (
|
||||
EnergieManagementSystem,
|
||||
@@ -28,14 +28,14 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
wechselrichter = Wechselrichter(WechselrichterParameters(max_leistung_wh=10000), akku)
|
||||
|
||||
# Household device (currently not used, set to None)
|
||||
home_appliance = Haushaltsgeraet(
|
||||
HaushaltsgeraetParameters(
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
home_appliance = HomeAppliance(
|
||||
HomeApplianceParameters(
|
||||
consumption_wh=2000,
|
||||
duration_h=2,
|
||||
),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
home_appliance.set_startzeitpunkt(2)
|
||||
home_appliance.set_starting_time(2)
|
||||
|
||||
# Example initialization of electric car battery
|
||||
eauto = PVAkku(
|
||||
@@ -212,7 +212,7 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
gesamtlast=gesamtlast,
|
||||
),
|
||||
eauto=eauto,
|
||||
haushaltsgeraet=home_appliance,
|
||||
home_appliance=home_appliance,
|
||||
wechselrichter=wechselrichter,
|
||||
)
|
||||
|
||||
@@ -270,7 +270,7 @@ def test_simulation(create_ems_instance):
|
||||
"Gesamtkosten_Euro",
|
||||
"Verluste_Pro_Stunde",
|
||||
"Gesamt_Verluste",
|
||||
"Haushaltsgeraet_wh_pro_stunde",
|
||||
"Home_appliance_wh_per_hour",
|
||||
]
|
||||
|
||||
for key in expected_keys:
|
||||
@@ -338,18 +338,18 @@ def test_simulation(create_ems_instance):
|
||||
|
||||
# Check home appliances
|
||||
assert (
|
||||
sum(ems.haushaltsgeraet.get_lastkurve()) == 2000
|
||||
), "The sum of 'ems.haushaltsgeraet.get_lastkurve()' should be 2000."
|
||||
sum(ems.home_appliance.get_load_curve()) == 2000
|
||||
), "The sum of 'ems.home_appliance.get_load_curve()' should be 2000."
|
||||
|
||||
assert (
|
||||
np.nansum(
|
||||
np.where(
|
||||
np.equal(result["Haushaltsgeraet_wh_pro_stunde"], None),
|
||||
np.equal(result["Home_appliance_wh_per_hour"], None),
|
||||
np.nan,
|
||||
np.array(result["Haushaltsgeraet_wh_pro_stunde"]),
|
||||
np.array(result["Home_appliance_wh_per_hour"]),
|
||||
)
|
||||
)
|
||||
== 2000
|
||||
), "The sum of 'Haushaltsgeraet_wh_pro_stunde' should be 2000."
|
||||
), "The sum of 'Home_appliance_wh_per_hour' should be 2000."
|
||||
|
||||
print("All tests passed successfully.")
|
||||
|
@@ -3,7 +3,7 @@ import pytest
|
||||
|
||||
from akkudoktoreos.config import AppConfig
|
||||
from akkudoktoreos.devices.battery import EAutoParameters, PVAkku, PVAkkuParameters
|
||||
from akkudoktoreos.devices.generic import Haushaltsgeraet, HaushaltsgeraetParameters
|
||||
from akkudoktoreos.devices.generic import HomeAppliance, HomeApplianceParameters
|
||||
from akkudoktoreos.devices.inverter import Wechselrichter, WechselrichterParameters
|
||||
from akkudoktoreos.prediction.ems import (
|
||||
EnergieManagementSystem,
|
||||
@@ -28,14 +28,14 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
wechselrichter = Wechselrichter(WechselrichterParameters(max_leistung_wh=10000), akku)
|
||||
|
||||
# Household device (currently not used, set to None)
|
||||
home_appliance = Haushaltsgeraet(
|
||||
HaushaltsgeraetParameters(
|
||||
verbrauch_wh=2000,
|
||||
dauer_h=2,
|
||||
home_appliance = HomeAppliance(
|
||||
HomeApplianceParameters(
|
||||
consumption_wh=2000,
|
||||
duration_h=2,
|
||||
),
|
||||
hours=prediction_hours,
|
||||
)
|
||||
home_appliance.set_startzeitpunkt(2)
|
||||
home_appliance.set_starting_time(2)
|
||||
|
||||
# Example initialization of electric car battery
|
||||
eauto = PVAkku(
|
||||
@@ -117,7 +117,7 @@ def create_ems_instance(tmp_config: AppConfig) -> EnergieManagementSystem:
|
||||
gesamtlast=gesamtlast,
|
||||
),
|
||||
eauto=eauto,
|
||||
haushaltsgeraet=home_appliance,
|
||||
home_appliance=home_appliance,
|
||||
wechselrichter=wechselrichter,
|
||||
)
|
||||
|
||||
@@ -182,7 +182,7 @@ def test_simulation(create_ems_instance):
|
||||
"Gesamtkosten_Euro",
|
||||
"Verluste_Pro_Stunde",
|
||||
"Gesamt_Verluste",
|
||||
"Haushaltsgeraet_wh_pro_stunde",
|
||||
"Home_appliance_wh_per_hour",
|
||||
]
|
||||
|
||||
for key in expected_keys:
|
||||
|
8
tests/testdata/optimize_input_2.json
vendored
8
tests/testdata/optimize_input_2.json
vendored
@@ -37,9 +37,9 @@
|
||||
"start_soc_prozent": 5,
|
||||
"min_soc_prozent": 80
|
||||
},
|
||||
"spuelmaschine" :{
|
||||
"verbrauch_wh": 5000,
|
||||
"dauer_h": 2
|
||||
"dishwasher" :{
|
||||
"consumption_wh": 5000,
|
||||
"duration_h": 2
|
||||
},
|
||||
"temperature_forecast": [
|
||||
18.3, 17.8, 16.9, 16.2, 15.6, 15.1, 14.6, 14.2, 14.3, 14.8, 15.7, 16.7, 17.4,
|
||||
@@ -48,4 +48,4 @@
|
||||
22.7, 23.1, 23.1, 22.8, 21.8, 20.2, 19.1, 18.0, 17.4
|
||||
],
|
||||
"start_solution": null
|
||||
}
|
||||
}
|
||||
|
4
tests/testdata/optimize_result_1.json
vendored
4
tests/testdata/optimize_result_1.json
vendored
@@ -475,7 +475,7 @@
|
||||
0.0
|
||||
],
|
||||
"Gesamt_Verluste": 1859.6205371900821,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
"Home_appliance_wh_per_hour": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
@@ -727,5 +727,5 @@
|
||||
1,
|
||||
1
|
||||
],
|
||||
"spuelstart": null
|
||||
"washingstart": null
|
||||
}
|
5
tests/testdata/optimize_result_2.json
vendored
5
tests/testdata/optimize_result_2.json
vendored
@@ -40,7 +40,8 @@
|
||||
957.818181818182, 447.0, 1152.0, 843.0, 846.7933884297522, 345.0, 276.0, 309.0, 0.0, 0.0, 0.0, 0.0, 124.41545454545451, 141.38119834710756, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 69.12409090909085, 0.0, 78.55010330578523, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.08954545454549, 80.85954545454547
|
||||
],
|
||||
"Gesamt_Verluste": 5771.031508264463,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
|
||||
"Home_appliance_wh_per_hour": [
|
||||
0.0, 0.0, 0.0, 2500.0, 2500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
]
|
||||
},
|
||||
@@ -62,5 +63,5 @@
|
||||
"start_solution": [
|
||||
0, 0, 4, 3, 1, 3, 1, 5, 6, 4, 1, 3, 6, 4, 6, 0, 6, 6, 0, 0, 3, 4, 1, 3, 2, 4, 4, 2, 3, 2, 1, 0, 2, 4, 1, 0, 6, 6, 2, 0, 4, 3, 3, 2, 6, 4, 1, 1, 0, 1, 5, 1, 2, 4, 6, 6, 5, 0, 2, 1, 6, 5, 6, 3, 2, 6, 6, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13
|
||||
],
|
||||
"spuelstart": 13
|
||||
"washingstart": 13
|
||||
}
|
4
tests/testdata/optimize_result_2_full.json
vendored
4
tests/testdata/optimize_result_2_full.json
vendored
@@ -40,7 +40,7 @@
|
||||
957.818181818182, 2.817272727272737, 672.0, 1152.0, 1152.0, 660.994834710744, 276.0, 276.0, 33.0, 0.0, 0.0, 0.0, 0.0, 0.0, 70.41409090909087, 118.37045454545455, 94.68272727272722, 83.01681818181817, 75.86045454545456, 66.66681818181814, 69.12409090909085, 109.0704545454546, 109.96227272727276, 47.952272727272714, 15.439199999999985, 53.855999999999995, 159.6443999999999, 21.032399999999996, 710.3921528925632, 0.0, 0.0, 0.0, 0.0, 35.132727272727266, 77.27590909090907, 134.59227272727276, 100.08954545454549, 80.85954545454547
|
||||
],
|
||||
"Gesamt_Verluste": 7416.064896694217,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
"Home_appliance_wh_per_hour": [
|
||||
0.0, 0.0, 0.0, 2500.0, 2500.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
||||
]
|
||||
},
|
||||
@@ -62,5 +62,5 @@
|
||||
"start_solution": [
|
||||
3, 2, 6, 3, 5, 4, 1, 5, 4, 6, 1, 1, 2, 6, 6, 6, 6, 6, 1, 2, 2, 6, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 6, 2, 2, 2, 6, 1, 1, 1, 1, 1, 0, 5, 3, 1, 1, 2, 0, 1, 0, 6, 2, 0, 6, 6, 6, 5, 2, 2, 3, 6, 1, 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13
|
||||
],
|
||||
"spuelstart": 13
|
||||
"washingstart": 13
|
||||
}
|
2
tests/testdata/visualize_input_1.json
vendored
2
tests/testdata/visualize_input_1.json
vendored
@@ -90,7 +90,7 @@
|
||||
100.08954545454549, 0.0
|
||||
],
|
||||
"Gesamt_Verluste": 6563.160567638104,
|
||||
"Haushaltsgeraet_wh_pro_stunde": [
|
||||
"Home_appliance_wh_per_hour": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
|
Reference in New Issue
Block a user