mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-12-02 18:36:28 +01:00
refactor(genetic0): refactor GENETIC0 to consolidated optimizer architecture
Pin the conversion, plan and visualization of golden runs. Drive GENETIC0 through the optimizer registry. Move GENETIC0 into one directory with role-named modules. Prepare every run input once, run from the parameters. Fall back on bad inputs instead of cancelling the run. Simulate from frozen device dataclasses, not settings. Convert and visualize from the parameters and result only. Serve GENETIC0 from its own router, return a frozen result. Additional changes - Fix the run start of the golden runs and add a run across the DST switch. - Configure a home appliance so the conversion covers it. - Pass the warm start to the legacy preparation instead of reading the EMS. - Replace EnergyManagement.genetic0_solution() by optimizer_result(name). - Cover the warm start of the parameter preparation. - Rename Genetic0OptimizationParameters to Genetic0Request, Genetic0CommonSettings to Genetic0Settings. - Say in ADR 0007 and the skill that a move relabels baseline entries one to one. - Record the renamed OpenAPI schemas in CHANGELOG.md and the upgrade guide. - Add the observation time to the optimizer interface. - Cache the load interpolator by its backend instead of in the EMS run cache. - Add replay files that reproduce each golden result from its parameters. - Stop writing demo providers, demo devices and defaults into the configuration. - Count a NaN state of charge as invalid. - Remove the unused electricity fee check. - Record the fallbacks in CHANGELOG.md instead of the former demo providers. - Leave out a battery that is not linked to the inverter. - Count infinite forecast values as missing. - Extend a prediction.hours that leaves fewer than two hours after the start hour. - Do not charge from the grid without any known price. - Without an inverter, buy the whole load from the grid instead of planning it at no cost. - Keep the zone of the run start in the replay files. - Correct the DVhub documentation that said a missing tariff cancels the run. - Rename the request models to <Name><Thing>Request. - Move the settings' to_genetic0_*() converters into the preparation. - Remove the solution's unreachable configuration fallbacks. - Record the renamed OpenAPI schemas in CHANGELOG.md and the upgrade guide. - Add EnergyManagement.optimizer_run() and render the PDF from the run's own start. - Read the presentation series from the earlier of the run's start hours. - Render the PDF report for runs of any length, not only 48 hours. - Add the generic OptimizerProblem, rendered like EOSProblem. - Move Genetic0ParametersBaseModel into genetic0request.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9adf7b8be2
commit
40d0fab9d2
@@ -0,0 +1,801 @@
|
||||
{
|
||||
"expected_result": "optimize_result_2_full.json",
|
||||
"parameters": {
|
||||
"request": {
|
||||
"ems": {
|
||||
"pv_forecast_wh": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
8.05,
|
||||
352.91,
|
||||
728.51,
|
||||
930.28,
|
||||
1043.25,
|
||||
1106.74,
|
||||
1161.69,
|
||||
6018.82,
|
||||
5519.07,
|
||||
3969.88,
|
||||
3017.96,
|
||||
1943.07,
|
||||
1007.17,
|
||||
319.67,
|
||||
7.88,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
5.04,
|
||||
335.59,
|
||||
705.32,
|
||||
1121.12,
|
||||
1604.79,
|
||||
2157.38,
|
||||
1433.25,
|
||||
5718.49,
|
||||
4553.96,
|
||||
3027.55,
|
||||
2574.46,
|
||||
1720.4,
|
||||
963.4,
|
||||
383.3,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"electricity_price_per_wh": [
|
||||
0.0003384,
|
||||
0.0003318,
|
||||
0.0003284,
|
||||
0.0003283,
|
||||
0.0003289,
|
||||
0.0003334,
|
||||
0.000329,
|
||||
0.0003302,
|
||||
0.0003042,
|
||||
0.000243,
|
||||
0.000228,
|
||||
0.0002212,
|
||||
0.0002093,
|
||||
0.0001879,
|
||||
0.0001838,
|
||||
0.0002004,
|
||||
0.0002198,
|
||||
0.000227,
|
||||
0.0002997,
|
||||
0.0003195,
|
||||
0.0003081,
|
||||
0.0002969,
|
||||
0.0002921,
|
||||
0.000278,
|
||||
0.0003384,
|
||||
0.0003318,
|
||||
0.0003284,
|
||||
0.0003283,
|
||||
0.0003289,
|
||||
0.0003334,
|
||||
0.000329,
|
||||
0.0003302,
|
||||
0.0003042,
|
||||
0.000243,
|
||||
0.000228,
|
||||
0.0002212,
|
||||
0.0002093,
|
||||
0.0001879,
|
||||
0.0001838,
|
||||
0.0002004,
|
||||
0.0002198,
|
||||
0.000227,
|
||||
0.0002997,
|
||||
0.0003195,
|
||||
0.0003081,
|
||||
0.0002969,
|
||||
0.0002921,
|
||||
0.000278
|
||||
],
|
||||
"feed_in_tariff_per_wh": 7e-05,
|
||||
"price_per_wh_battery": 0.0,
|
||||
"total_load": [
|
||||
676.71,
|
||||
876.19,
|
||||
527.13,
|
||||
468.88,
|
||||
531.38,
|
||||
517.95,
|
||||
483.15,
|
||||
472.28,
|
||||
1011.68,
|
||||
995.0,
|
||||
1053.07,
|
||||
1063.91,
|
||||
1320.56,
|
||||
1132.03,
|
||||
1163.67,
|
||||
1176.82,
|
||||
1216.22,
|
||||
1103.78,
|
||||
1129.12,
|
||||
1178.71,
|
||||
1050.98,
|
||||
988.56,
|
||||
912.38,
|
||||
704.61,
|
||||
516.37,
|
||||
868.05,
|
||||
694.34,
|
||||
608.79,
|
||||
556.31,
|
||||
488.89,
|
||||
506.91,
|
||||
804.89,
|
||||
1141.98,
|
||||
1056.97,
|
||||
992.46,
|
||||
1155.99,
|
||||
827.01,
|
||||
1257.98,
|
||||
1232.67,
|
||||
871.26,
|
||||
860.88,
|
||||
1158.03,
|
||||
1222.72,
|
||||
1221.04,
|
||||
949.99,
|
||||
987.01,
|
||||
733.99,
|
||||
592.97
|
||||
],
|
||||
"pv_prognose_wh": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
8.05,
|
||||
352.91,
|
||||
728.51,
|
||||
930.28,
|
||||
1043.25,
|
||||
1106.74,
|
||||
1161.69,
|
||||
6018.82,
|
||||
5519.07,
|
||||
3969.88,
|
||||
3017.96,
|
||||
1943.07,
|
||||
1007.17,
|
||||
319.67,
|
||||
7.88,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
5.04,
|
||||
335.59,
|
||||
705.32,
|
||||
1121.12,
|
||||
1604.79,
|
||||
2157.38,
|
||||
1433.25,
|
||||
5718.49,
|
||||
4553.96,
|
||||
3027.55,
|
||||
2574.46,
|
||||
1720.4,
|
||||
963.4,
|
||||
383.3,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"strompreis_euro_pro_wh": [
|
||||
0.0003384,
|
||||
0.0003318,
|
||||
0.0003284,
|
||||
0.0003283,
|
||||
0.0003289,
|
||||
0.0003334,
|
||||
0.000329,
|
||||
0.0003302,
|
||||
0.0003042,
|
||||
0.000243,
|
||||
0.000228,
|
||||
0.0002212,
|
||||
0.0002093,
|
||||
0.0001879,
|
||||
0.0001838,
|
||||
0.0002004,
|
||||
0.0002198,
|
||||
0.000227,
|
||||
0.0002997,
|
||||
0.0003195,
|
||||
0.0003081,
|
||||
0.0002969,
|
||||
0.0002921,
|
||||
0.000278,
|
||||
0.0003384,
|
||||
0.0003318,
|
||||
0.0003284,
|
||||
0.0003283,
|
||||
0.0003289,
|
||||
0.0003334,
|
||||
0.000329,
|
||||
0.0003302,
|
||||
0.0003042,
|
||||
0.000243,
|
||||
0.000228,
|
||||
0.0002212,
|
||||
0.0002093,
|
||||
0.0001879,
|
||||
0.0001838,
|
||||
0.0002004,
|
||||
0.0002198,
|
||||
0.000227,
|
||||
0.0002997,
|
||||
0.0003195,
|
||||
0.0003081,
|
||||
0.0002969,
|
||||
0.0002921,
|
||||
0.000278
|
||||
],
|
||||
"einspeiseverguetung_euro_pro_wh": 7e-05,
|
||||
"preis_euro_pro_wh_akku": 0.0,
|
||||
"gesamtlast": [
|
||||
676.71,
|
||||
876.19,
|
||||
527.13,
|
||||
468.88,
|
||||
531.38,
|
||||
517.95,
|
||||
483.15,
|
||||
472.28,
|
||||
1011.68,
|
||||
995.0,
|
||||
1053.07,
|
||||
1063.91,
|
||||
1320.56,
|
||||
1132.03,
|
||||
1163.67,
|
||||
1176.82,
|
||||
1216.22,
|
||||
1103.78,
|
||||
1129.12,
|
||||
1178.71,
|
||||
1050.98,
|
||||
988.56,
|
||||
912.38,
|
||||
704.61,
|
||||
516.37,
|
||||
868.05,
|
||||
694.34,
|
||||
608.79,
|
||||
556.31,
|
||||
488.89,
|
||||
506.91,
|
||||
804.89,
|
||||
1141.98,
|
||||
1056.97,
|
||||
992.46,
|
||||
1155.99,
|
||||
827.01,
|
||||
1257.98,
|
||||
1232.67,
|
||||
871.26,
|
||||
860.88,
|
||||
1158.03,
|
||||
1222.72,
|
||||
1221.04,
|
||||
949.99,
|
||||
987.01,
|
||||
733.99,
|
||||
592.97
|
||||
]
|
||||
},
|
||||
"pv_battery": {
|
||||
"device_id": "battery1",
|
||||
"hours": null,
|
||||
"capacity_wh": 26400,
|
||||
"charging_efficiency": 0.88,
|
||||
"discharging_efficiency": 0.88,
|
||||
"max_charge_power_w": 5000.0,
|
||||
"max_discharge_power_w": null,
|
||||
"initial_soc_percentage": 80,
|
||||
"min_soc_percentage": 0,
|
||||
"max_soc_percentage": 100,
|
||||
"charge_rates": null
|
||||
},
|
||||
"inverter": {
|
||||
"device_id": "inverter1",
|
||||
"hours": null,
|
||||
"max_power_wh": 10000.0,
|
||||
"battery_id": "battery1",
|
||||
"ac_to_dc_efficiency": 1.0,
|
||||
"dc_to_ac_efficiency": 1.0,
|
||||
"max_ac_charge_power_w": null
|
||||
},
|
||||
"ev": {
|
||||
"device_id": "ev1",
|
||||
"hours": null,
|
||||
"capacity_wh": 60000,
|
||||
"charging_efficiency": 0.95,
|
||||
"discharging_efficiency": 1.0,
|
||||
"max_charge_power_w": 11040.0,
|
||||
"max_discharge_power_w": null,
|
||||
"initial_soc_percentage": 5,
|
||||
"min_soc_percentage": 80,
|
||||
"max_soc_percentage": 100,
|
||||
"charge_rates": null
|
||||
},
|
||||
"dishwasher": {
|
||||
"device_id": "dishwasher1",
|
||||
"hours": null,
|
||||
"consumption_wh": 5000,
|
||||
"duration_h": 2,
|
||||
"time_windows": {
|
||||
"windows": [
|
||||
{
|
||||
"start_time": "00:00:00.000000",
|
||||
"duration": "2 days",
|
||||
"end_time": null,
|
||||
"day_of_week": null,
|
||||
"date": null,
|
||||
"month": null,
|
||||
"locale": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"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,
|
||||
18.0,
|
||||
18.6,
|
||||
19.2,
|
||||
19.1,
|
||||
18.7,
|
||||
18.5,
|
||||
17.7,
|
||||
16.2,
|
||||
14.6,
|
||||
13.6,
|
||||
13.0,
|
||||
12.6,
|
||||
12.2,
|
||||
11.7,
|
||||
11.6,
|
||||
11.3,
|
||||
11.0,
|
||||
10.7,
|
||||
10.2,
|
||||
11.4,
|
||||
14.4,
|
||||
16.4,
|
||||
18.3,
|
||||
19.5,
|
||||
20.7,
|
||||
21.9,
|
||||
22.7,
|
||||
23.1,
|
||||
23.1,
|
||||
22.8,
|
||||
21.8,
|
||||
20.2,
|
||||
19.1,
|
||||
18.0,
|
||||
17.4
|
||||
],
|
||||
"start_solution": null,
|
||||
"pv_akku": {
|
||||
"device_id": "battery1",
|
||||
"hours": null,
|
||||
"capacity_wh": 26400,
|
||||
"charging_efficiency": 0.88,
|
||||
"discharging_efficiency": 0.88,
|
||||
"max_charge_power_w": 5000.0,
|
||||
"max_discharge_power_w": null,
|
||||
"initial_soc_percentage": 80,
|
||||
"min_soc_percentage": 0,
|
||||
"max_soc_percentage": 100,
|
||||
"charge_rates": null
|
||||
},
|
||||
"eauto": {
|
||||
"device_id": "ev1",
|
||||
"hours": null,
|
||||
"capacity_wh": 60000,
|
||||
"charging_efficiency": 0.95,
|
||||
"discharging_efficiency": 1.0,
|
||||
"max_charge_power_w": 11040.0,
|
||||
"max_discharge_power_w": null,
|
||||
"initial_soc_percentage": 5,
|
||||
"min_soc_percentage": 80,
|
||||
"max_soc_percentage": 100,
|
||||
"charge_rates": null
|
||||
}
|
||||
},
|
||||
"start_hour": 10,
|
||||
"settings": {
|
||||
"prediction_hours": 48,
|
||||
"horizon_hours": 48,
|
||||
"individuals": 300,
|
||||
"generations": 400,
|
||||
"seed": 42,
|
||||
"penalties": {
|
||||
"ev_soc_miss": 10,
|
||||
"ac_charge_break_even": 0
|
||||
},
|
||||
"ev_charge_rates": [
|
||||
0.0,
|
||||
0.375,
|
||||
0.5,
|
||||
0.625,
|
||||
0.75,
|
||||
0.875,
|
||||
1.0
|
||||
],
|
||||
"battery_charge_rates": null,
|
||||
"self_consumption_interpolator": "scipy",
|
||||
"verbose": false
|
||||
},
|
||||
"presentation": {
|
||||
"start_datetime": {
|
||||
"datetime": "2026-01-14T10:00:00+01:00",
|
||||
"timezone": "Europe/Berlin"
|
||||
},
|
||||
"timezone": "Europe/Berlin",
|
||||
"battery_device_id": "battery1",
|
||||
"ev_device_id": "ev1",
|
||||
"home_appliance_device_id": "homeappliance1",
|
||||
"home_appliance_enabled": true,
|
||||
"prediction_series": {
|
||||
"pvforecast_ac_power": [
|
||||
170.5,
|
||||
171.0,
|
||||
171.5,
|
||||
172.0,
|
||||
172.5,
|
||||
173.0,
|
||||
173.5,
|
||||
174.0,
|
||||
174.5,
|
||||
175.0,
|
||||
175.5,
|
||||
176.0,
|
||||
176.5,
|
||||
177.0,
|
||||
177.5,
|
||||
178.0,
|
||||
178.5,
|
||||
179.0,
|
||||
179.5,
|
||||
180.0,
|
||||
180.5,
|
||||
181.0,
|
||||
181.5,
|
||||
182.0,
|
||||
182.5,
|
||||
183.0,
|
||||
183.5,
|
||||
184.0,
|
||||
184.5,
|
||||
185.0,
|
||||
185.5,
|
||||
186.0,
|
||||
186.5,
|
||||
187.0,
|
||||
187.5,
|
||||
188.0,
|
||||
188.5,
|
||||
189.0
|
||||
],
|
||||
"pvforecast_dc_power": [
|
||||
180.5,
|
||||
181.0,
|
||||
181.5,
|
||||
182.0,
|
||||
182.5,
|
||||
183.0,
|
||||
183.5,
|
||||
184.0,
|
||||
184.5,
|
||||
185.0,
|
||||
185.5,
|
||||
186.0,
|
||||
186.5,
|
||||
187.0,
|
||||
187.5,
|
||||
188.0,
|
||||
188.5,
|
||||
189.0,
|
||||
189.5,
|
||||
190.0,
|
||||
190.5,
|
||||
191.0,
|
||||
191.5,
|
||||
192.0,
|
||||
192.5,
|
||||
193.0,
|
||||
193.5,
|
||||
194.0,
|
||||
194.5,
|
||||
195.0,
|
||||
195.5,
|
||||
196.0,
|
||||
196.5,
|
||||
197.0,
|
||||
197.5,
|
||||
198.0,
|
||||
198.5,
|
||||
199.0
|
||||
],
|
||||
"elecprice_marketprice_wh": [
|
||||
1190.5,
|
||||
1191.0,
|
||||
1191.5,
|
||||
1192.0,
|
||||
1192.5,
|
||||
1193.0,
|
||||
1193.5,
|
||||
1194.0,
|
||||
1194.5,
|
||||
1195.0,
|
||||
1195.5,
|
||||
1196.0,
|
||||
1196.5,
|
||||
1197.0,
|
||||
1197.5,
|
||||
1198.0,
|
||||
1198.5,
|
||||
1199.0,
|
||||
1199.5,
|
||||
1200.0,
|
||||
1200.5,
|
||||
1201.0,
|
||||
1201.5,
|
||||
1202.0,
|
||||
1202.5,
|
||||
1203.0,
|
||||
1203.5,
|
||||
1204.0,
|
||||
1204.5,
|
||||
1205.0,
|
||||
1205.5,
|
||||
1206.0,
|
||||
1206.5,
|
||||
1207.0,
|
||||
1207.5,
|
||||
1208.0,
|
||||
1208.5,
|
||||
1209.0
|
||||
],
|
||||
"feed_in_tariff_wh": [
|
||||
1200.5,
|
||||
1201.0,
|
||||
1201.5,
|
||||
1202.0,
|
||||
1202.5,
|
||||
1203.0,
|
||||
1203.5,
|
||||
1204.0,
|
||||
1204.5,
|
||||
1205.0,
|
||||
1205.5,
|
||||
1206.0,
|
||||
1206.5,
|
||||
1207.0,
|
||||
1207.5,
|
||||
1208.0,
|
||||
1208.5,
|
||||
1209.0,
|
||||
1209.5,
|
||||
1210.0,
|
||||
1210.5,
|
||||
1211.0,
|
||||
1211.5,
|
||||
1212.0,
|
||||
1212.5,
|
||||
1213.0,
|
||||
1213.5,
|
||||
1214.0,
|
||||
1214.5,
|
||||
1215.0,
|
||||
1215.5,
|
||||
1216.0,
|
||||
1216.5,
|
||||
1217.0,
|
||||
1217.5,
|
||||
1218.0,
|
||||
1218.5,
|
||||
1219.0
|
||||
],
|
||||
"weather_temp_air": [
|
||||
210.5,
|
||||
211.0,
|
||||
211.5,
|
||||
212.0,
|
||||
212.5,
|
||||
213.0,
|
||||
213.5,
|
||||
214.0,
|
||||
214.5,
|
||||
215.0,
|
||||
215.5,
|
||||
216.0,
|
||||
216.5,
|
||||
217.0,
|
||||
217.5,
|
||||
218.0,
|
||||
218.5,
|
||||
219.0,
|
||||
219.5,
|
||||
220.0,
|
||||
220.5,
|
||||
221.0,
|
||||
221.5,
|
||||
222.0,
|
||||
222.5,
|
||||
223.0,
|
||||
223.5,
|
||||
224.0,
|
||||
224.5,
|
||||
225.0,
|
||||
225.5,
|
||||
226.0,
|
||||
226.5,
|
||||
227.0,
|
||||
227.5,
|
||||
228.0,
|
||||
228.5,
|
||||
229.0
|
||||
],
|
||||
"loadforecast_power_w": [
|
||||
220.5,
|
||||
221.0,
|
||||
221.5,
|
||||
222.0,
|
||||
222.5,
|
||||
223.0,
|
||||
223.5,
|
||||
224.0,
|
||||
224.5,
|
||||
225.0,
|
||||
225.5,
|
||||
226.0,
|
||||
226.5,
|
||||
227.0,
|
||||
227.5,
|
||||
228.0,
|
||||
228.5,
|
||||
229.0,
|
||||
229.5,
|
||||
230.0,
|
||||
230.5,
|
||||
231.0,
|
||||
231.5,
|
||||
232.0,
|
||||
232.5,
|
||||
233.0,
|
||||
233.5,
|
||||
234.0,
|
||||
234.5,
|
||||
235.0,
|
||||
235.5,
|
||||
236.0,
|
||||
236.5,
|
||||
237.0,
|
||||
237.5,
|
||||
238.0,
|
||||
238.5,
|
||||
239.0
|
||||
],
|
||||
"loadakkudoktor_std_power_w": [
|
||||
230.5,
|
||||
231.0,
|
||||
231.5,
|
||||
232.0,
|
||||
232.5,
|
||||
233.0,
|
||||
233.5,
|
||||
234.0,
|
||||
234.5,
|
||||
235.0,
|
||||
235.5,
|
||||
236.0,
|
||||
236.5,
|
||||
237.0,
|
||||
237.5,
|
||||
238.0,
|
||||
238.5,
|
||||
239.0,
|
||||
239.5,
|
||||
240.0,
|
||||
240.5,
|
||||
241.0,
|
||||
241.5,
|
||||
242.0,
|
||||
242.5,
|
||||
243.0,
|
||||
243.5,
|
||||
244.0,
|
||||
244.5,
|
||||
245.0,
|
||||
245.5,
|
||||
246.0,
|
||||
246.5,
|
||||
247.0,
|
||||
247.5,
|
||||
248.0,
|
||||
248.5,
|
||||
249.0
|
||||
],
|
||||
"loadakkudoktor_mean_power_w": [
|
||||
240.5,
|
||||
241.0,
|
||||
241.5,
|
||||
242.0,
|
||||
242.5,
|
||||
243.0,
|
||||
243.5,
|
||||
244.0,
|
||||
244.5,
|
||||
245.0,
|
||||
245.5,
|
||||
246.0,
|
||||
246.5,
|
||||
247.0,
|
||||
247.5,
|
||||
248.0,
|
||||
248.5,
|
||||
249.0,
|
||||
249.5,
|
||||
250.0,
|
||||
250.5,
|
||||
251.0,
|
||||
251.5,
|
||||
252.0,
|
||||
252.5,
|
||||
253.0,
|
||||
253.5,
|
||||
254.0,
|
||||
254.5,
|
||||
255.0,
|
||||
255.5,
|
||||
256.0,
|
||||
256.5,
|
||||
257.0,
|
||||
257.5,
|
||||
258.0,
|
||||
258.5,
|
||||
259.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user