Skip to content

Commit

Permalink
Log heat pump awareness over time in model
Browse files Browse the repository at this point in the history
  • Loading branch information
charlotte-avery committed Nov 20, 2024
1 parent 0c2e58c commit 7463a57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions simulation/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ def make_decisions(self, model):
self.update_heating_status(model)
self.evaluate_renovation(model)

if self.is_heat_pump_aware:
model.households_heat_pump_aware_at_current_step += 1

if self.is_renovating:
if self.renovate_insulation:
chosen_elements = self.get_chosen_insulation_costs(
Expand Down
7 changes: 6 additions & 1 deletion simulation/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ def model_heat_pump_installations_at_current_step(model) -> int:
return model.heat_pump_installations_at_current_step


def model_heat_pump_awareness_at_timestep(model) -> float:
return model.heat_pump_awareness_at_timestep


def is_first_timestep(model: "DomesticHeatingABM") -> bool:
return model.current_datetime == model.start_datetime + model.step_interval

Expand All @@ -303,7 +307,6 @@ def get_agent_collectors(
collect_when(model, is_first_timestep)(household_discount_rate),
collect_when(model, is_first_timestep)(household_renovation_budget),
collect_when(model, is_first_timestep)(household_is_heat_pump_suitable),
collect_when(model, is_first_timestep)(household_is_heat_pump_aware),
household_heating_system,
household_heating_system_previous,
household_heating_functioning,
Expand Down Expand Up @@ -340,6 +343,7 @@ def get_agent_collectors(
household_heating_system_costs_insulation_heat_pump_air_source,
household_heating_system_costs_insulation_heat_pump_ground_source,
household_boiler_upgrade_grant_used,
household_is_heat_pump_aware,
]


Expand All @@ -355,4 +359,5 @@ def get_model_collectors(
collect_when(model, is_first_timestep)(model_price_gbp_per_kwh_gas),
collect_when(model, is_first_timestep)(model_price_gbp_per_kwh_electricity),
collect_when(model, is_first_timestep)(model_price_gbp_per_kwh_oil),
model_heat_pump_awareness_at_timestep,
]
6 changes: 6 additions & 0 deletions simulation/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def __init__(
)
self.heat_pump_installations_at_current_step = 0
self.annual_new_builds = annual_new_builds
self.households_heat_pump_aware_at_current_step = 0

super().__init__(UnorderedSpace())

Expand Down Expand Up @@ -193,12 +194,17 @@ def boiler_upgrade_scheme_spend_gbp(self) -> int:
]
)

@property
def heat_pump_awareness_at_timestep(self) -> float:
return self.households_heat_pump_aware_at_current_step / self.household_count

def increment_timestep(self):
self.current_datetime += self.step_interval
self.boiler_upgrade_scheme_cumulative_spend_gbp += (
self.boiler_upgrade_scheme_spend_gbp
)
self.heat_pump_installations_at_current_step = 0
self.households_heat_pump_aware_at_current_step = 0


def create_household_agents(
Expand Down

0 comments on commit 7463a57

Please sign in to comment.