Skip to content

Commit

Permalink
Update model assumptions (EPC upgrade + HP installers) (#142)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
charlotte-avery authored Oct 23, 2024
1 parent 0c18289 commit c6e8843
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion k8s/job.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local job(name, args_excl_output) = {
namespace: 'domestic-heating-abm',
},
spec: {
completions: 30,
completions: 10,
parallelism: 5,
template: {
spec: {
Expand Down
2 changes: 1 addition & 1 deletion simulation/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)

Expand Down
6 changes: 3 additions & 3 deletions simulation/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = {}
Expand Down
2 changes: 1 addition & 1 deletion simulation/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions simulation/tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c6e8843

Please sign in to comment.