From c6e8843b5eaf8bf1b1be69fa00deabd849613064 Mon Sep 17 00:00:00 2001 From: Charlotte Avery <143102500+charlotte-avery@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:47:04 +0100 Subject: [PATCH] Update model assumptions (EPC upgrade + HP installers) (#142) * Update initial number of installers * Update EPC requirements for HP - BUS grant does not have insulation requirements (where as outdated RHI did). - Assume that households still upgrade to at least EPC D when installing a HP. * Run 10 model iterations --- k8s/job.jsonnet | 2 +- simulation/__main__.py | 2 +- simulation/agents.py | 6 +++--- simulation/constants.py | 2 +- simulation/tests/test_agents.py | 20 ++++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/k8s/job.jsonnet b/k8s/job.jsonnet index 647d660..c763e31 100644 --- a/k8s/job.jsonnet +++ b/k8s/job.jsonnet @@ -6,7 +6,7 @@ local job(name, args_excl_output) = { namespace: 'domestic-heating-abm', }, spec: { - completions: 30, + completions: 10, parallelism: 5, template: { spec: { diff --git a/simulation/__main__.py b/simulation/__main__.py index 101191f..ff7d1b0 100644 --- a/simulation/__main__.py +++ b/simulation/__main__.py @@ -129,7 +129,7 @@ def format_uuid(str): parser.add_argument( "--heat-pump-installer-count", type=float, - default=2_800, + default=10_800, help="The number of HP installers at the start of the simulation.", ) diff --git a/simulation/agents.py b/simulation/agents.py index a744c64..276c130 100644 --- a/simulation/agents.py +++ b/simulation/agents.py @@ -333,10 +333,10 @@ def get_num_insulation_elements(self, event_trigger: EventTrigger) -> int: weights=RENO_NUM_INSULATION_ELEMENTS_UPGRADED.values(), )[0] - if event_trigger == EventTrigger.EPC_C_UPGRADE: + if event_trigger == EventTrigger.EPC_D_UPGRADE: # The number of insulation elements a household would require to reach epc_rating C # We assume each insulation measure will contribute +1 EPC grade - return max(0, EPCRating.C.value - self.epc_rating.value) + return max(0, EPCRating.D.value - self.epc_rating.value) return 0 @@ -636,7 +636,7 @@ def make_decisions(self, model): model, event_trigger=EventTrigger.RENOVATION ) chosen_insulation_costs = self.get_chosen_insulation_costs( - event_trigger=EventTrigger.EPC_C_UPGRADE + event_trigger=EventTrigger.EPC_D_UPGRADE ) costs_unit_and_install = {} diff --git a/simulation/constants.py b/simulation/constants.py index 56e8e9d..6335079 100644 --- a/simulation/constants.py +++ b/simulation/constants.py @@ -119,7 +119,7 @@ class InsulationSegment(enum.Enum): class EventTrigger(enum.Enum): BREAKDOWN = 0 RENOVATION = 1 - EPC_C_UPGRADE = 2 + EPC_D_UPGRADE = 2 # Scale factor is inferred from general relationship between estimated floor area and kW capacity diff --git a/simulation/tests/test_agents.py b/simulation/tests/test_agents.py index 33fb74c..fabc19a 100644 --- a/simulation/tests/test_agents.py +++ b/simulation/tests/test_agents.py @@ -161,18 +161,18 @@ def test_num_insulation_measures_chosen_by_household_corresponds_to_current_epc_ ) -> None: household = household_factory(epc_rating=epc_rating) - if household.epc_rating.value < EPCRating.C.value: - expected_insulation_elements = EPCRating.C.value - epc_rating.value + if household.epc_rating.value < EPCRating.D.value: + expected_insulation_elements = EPCRating.D.value - epc_rating.value assert ( household.get_num_insulation_elements( - event_trigger=EventTrigger.EPC_C_UPGRADE + event_trigger=EventTrigger.EPC_D_UPGRADE ) == expected_insulation_elements ) - if household.epc_rating.value >= EPCRating.C.value: + if household.epc_rating.value >= EPCRating.D.value: assert ( household.get_num_insulation_elements( - event_trigger=EventTrigger.EPC_C_UPGRADE + event_trigger=EventTrigger.EPC_D_UPGRADE ) == 0 ) @@ -453,24 +453,24 @@ def test_annual_heating_demand_is_lower_for_more_efficient_heating_systems( ) @pytest.mark.parametrize("epc_rating", list(EPCRating)) - def test_household_chooses_insulation_elements_at_epc_C_upgrade_event_if_current_epc_worse_than_C( + def test_household_chooses_insulation_elements_at_epc_D_upgrade_event_if_current_epc_worse_than_C( self, epc_rating, ) -> None: household = household_factory(epc_rating=epc_rating) - if epc_rating.value >= EPCRating.C.value: + if epc_rating.value >= EPCRating.D.value: assert ( household.get_chosen_insulation_costs( - event_trigger=EventTrigger.EPC_C_UPGRADE + event_trigger=EventTrigger.EPC_D_UPGRADE ) == {} ) - if epc_rating.value < EPCRating.C.value: + if epc_rating.value < EPCRating.D.value: chosen_insulation_elements = household.get_chosen_insulation_costs( - event_trigger=EventTrigger.EPC_C_UPGRADE + event_trigger=EventTrigger.EPC_D_UPGRADE ) assert chosen_insulation_elements