From af6674497995529ca82ea398ede6243d250ab7f5 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 9 Jul 2024 17:37:37 +0100 Subject: [PATCH] added adjust cost differences --- recommendations/Recommendations.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 470b0554..806e4d23 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -527,6 +527,32 @@ class Recommendations: new_heat_demand ) + # We now estimate the adjusted cost savings for the recommendation + predicted_heating_cost_reduction = ( + heating_cost_phase_impact[heating_cost_phase_impact["phase"] == previous_phase][ + "adjusted_cost" + ].values[0] - new_heating_cost + ) + predicted_heating_cost_reduction = ( + 0 if predicted_heating_cost_reduction < 0 else predicted_heating_cost_reduction + ) + + predicted_hot_water_cost_reduction = ( + hot_water_cost_phase_impact[hot_water_cost_phase_impact["phase"] == previous_phase][ + "adjusted_cost" + ].values[0] - new_hot_water_cost + ) + predicted_hot_water_cost_reduction = ( + 0 if predicted_hot_water_cost_reduction < 0 else predicted_hot_water_cost_reduction + ) + + # Only lighting recommendations can have an impact here + predicted_lighting_cost_reduction = 0 if rec["type"] != "lighting" else ( + lighting_cost_phase_impact[lighting_cost_phase_impact["phase"] == previous_phase][ + "adjusted_cost" + ].values[0] - new_lighting_cost + ) + if rec["type"] == "low_energy_lighting": # For the moment, we cap the number of SAP points that can be achieved by ventilation at 2 rec["sap_points"] = min(predicted_sap_points, LightingRecommendations.SAP_LIMIT)