Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for sudden increase in the heat pump awareness #148

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right variable? Should you have the at_current_step suffix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is referring to the property DomesticHeatingABM.heat_pump_awareness defined in models.py which returns households_heat_pump_aware_at_current_step / household_count, which is what I want.



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
Loading