-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update household heat pump awareness over time #149
Update household heat pump awareness over time #149
Conversation
All agents do not necessarily become HP aware at the ban announcement.
simulation/agents.py
Outdated
|
||
if InterventionType.HEAT_PUMP_CAMPAIGN in model.interventions: | ||
if ( | ||
model.current_datetime == model.heat_pump_awareness_campaign_date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this hard ==
safe? If user input is say '2028-01-31' will this work?
Maybe a safer one would be model.current_datetime >= model.heat_pump_awareness_campaign_date..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change the logging to implement this. See latest commit.
In summary: we want to say "if the target HP awareness has not been met in the previous timestep (t-1), give a suitable probability of converting agents to becoming HP aware to meet the target at timestep t", however, before the HP awareness was recalculated every timestep (every timestep, HP awareness set to value of zero, then using the line of code in agents.py: model.households_heat_pump_aware_at_current_step += 1
we count the HP awareness in that timstep). Remember, the simulation loops over each agent every timestep. So if you are on agent num. 3 in the loop, the HP awareness is calculated by looking at how many of the 3 agents are heat pump aware so far, and on timestep 5, we see the HP awareness by looking at how many of the 5 agents are heat pump aware so far etc. So we need to store the HP awareness at t-1, to access it at t, so we can convert a suitable number of households to become HP aware to meet the target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - much cleaner and straightforward implementation. Just 1 small comment on the very strict date comparison!
bc959fd
to
cfabbf5
Compare
if ( | ||
InterventionType.HEAT_PUMP_CAMPAIGN in model.interventions | ||
and model.current_datetime == model.heat_pump_awareness_campaign_date | ||
and model.current_datetime >= model.heat_pump_awareness_campaign_date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How confident are you with this implementation? Is it worth having a test to test this logic? Up to you to decide!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a suggest for test but leave it up to you to decide!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The probability of becoming HP aware needs to be calcuated at the beginning of the timestep and stay fixed throughout the timestep. Here a correction term is added to the probability to account for agents becoming HP aware during the timestep.
8af572a
to
11d7580
Compare
Add heat pump awareness campaign intervention:
heat-pump-awareness-campaign-date
) and the target heat pump awareness for the campaign (campaign-target-heat-pump-awareness
).campaign-target-heat-pump-awareness > heat-pump-awareness
a ValueError is raised (campaign should never decreases awareness).campaign-target-heat-pump-awareness
.Code no longer updates to 100% awareness at the boiler ban announcement date:
campaign-target-heat-pump-awareness=1
.