Skip to content

Commit

Permalink
Log HP awareness in the model over time
Browse files Browse the repository at this point in the history
  • Loading branch information
charlotte-avery committed Nov 18, 2024
1 parent cf705ee commit 4f3f285
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simulation/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,6 @@ def make_decisions(self, model):
self.heating_system_costs_subsidies = costs_subsidies
self.heating_system_costs_insulation = costs_insulation
self.insulation_element_upgrade_costs = chosen_insulation_costs

if self.is_heat_pump_aware:
model.households_heat_pump_aware_at_current_step += 1
5 changes: 5 additions & 0 deletions 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(model) -> int:
return model.heat_pump_awareness


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

Expand Down Expand Up @@ -352,6 +356,7 @@ def get_model_collectors(
model_heat_pump_installers,
model_heat_pump_installation_capacity_per_step,
model_heat_pump_installations_at_current_step,
model_heat_pump_awareness,
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),
Expand Down
6 changes: 6 additions & 0 deletions simulation/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(
heat_pump_installer_annual_growth_rate
)
self.heat_pump_installations_at_current_step = 0
self.households_heat_pump_aware_at_current_step = 0
self.annual_new_builds = annual_new_builds

super().__init__(UnorderedSpace())
Expand All @@ -81,6 +82,10 @@ def __init__(
def household_count(self) -> int:
return len(self.space.agents)

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

@property
def heat_pump_installers(self) -> int:

Expand Down Expand Up @@ -199,6 +204,7 @@ def increment_timestep(self):
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 4f3f285

Please sign in to comment.