Added solar recommendations to Recommendation class

This commit is contained in:
Khalim Conn-Kowlessar 2024-01-05 12:50:27 +00:00
parent c3dbec6703
commit 74a4cc1068
2 changed files with 10 additions and 0 deletions

View file

@ -89,6 +89,7 @@ class Property(Definitions):
self.floor_level = None
self.number_of_windows = None
self.solar_pv_roof_area = None
self.solar_pv_percentage = None
self.current_adjusted_energy = None
self.expected_adjusted_energy = None
@ -886,3 +887,5 @@ class Property(Definitions):
self.insulation_floor_area * percentage_of_roof if self.roof["is_flat"] else
self.pitched_roof_area * percentage_of_roof
)
self.solar_pv_percentage = percentage_of_roof

View file

@ -6,6 +6,7 @@ from recommendations.RoofRecommendations import RoofRecommendations
from recommendations.VentilationRecommendations import VentilationRecommendations
from recommendations.FireplaceRecommendations import FireplaceRecommendations
from recommendations.LightingRecommendations import LightingRecommendations
from recommendations.SolarPvRecommendations import SolarPvRecommendations
from recommendations.WindowsRecommendations import WindowsRecommendations
from backend.ml_models.AnnualBillSavings import AnnualBillSavings
@ -37,6 +38,7 @@ class Recommendations:
self.fireplace_recommender = FireplaceRecommendations(property_instance=property_instance)
self.lighting_recommender = LightingRecommendations(property_instance=property_instance, materials=materials)
self.windows_recommender = WindowsRecommendations(property_instance=property_instance, materials=materials)
self.solar_recommender = SolarPvRecommendations(property_instance=property_instance)
def recommend(self):
@ -84,6 +86,11 @@ class Recommendations:
if self.windows_recommender.recommendation:
property_recommendations.append(self.windows_recommender.recommendation)
# Solar recommendations
self.solar_recommender.recommend()
if self.solar_recommender.recommendation:
property_recommendations.append(self.solar_recommender.recommendation)
# We insert temporary ids into the recommendations which is important for the optimiser later
property_recommendations = self.insert_temp_recommendation_id(property_recommendations)