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

Spillover feature for WashingMachine and Dishwasher #54

Merged
merged 2 commits into from
Feb 14, 2025
Merged

Conversation

val-ismaili
Copy link
Collaborator

@val-ismaili val-ismaili commented Feb 13, 2025

Closes #57

This introduces logic for handling consumption and discharge simulations that extend into a different day (past midnight).

User can apply this by running:

consumption, discharge = house.simulate(duration='3 day', num_patterns=1, simulate_discharge=True, spillover=True)

Key points here are that:

  • spillover is an optional feature. By default, the event will just be cropped out if it extends past the end of simulation.
  • When spillover is True and a single day is simulated, the event extending past midnight will spill back into the start of the same day.
  • When spillover is True and multiple days are simulated, if an event extends past midnight that is not the final day in the simulation (e.g. day 2 of 4), it will just carry onto the next day as normal. However, if the event occurs on the final day in the simulation and extends past midnight it will spill back into the start of the simulation on the first day.

The value of the spillover feature is that if the user requires, it preserves antecedent conditions for the given time period (number of days) simulated.

Note that this is currently only applied to the WashingMachine and Dishwasher appliances.

Two day consumption (past midnight on day 1)

twodayconsumption

Two day discharge (past midnight on day 1)

twodaydischarge

Three day consumption (past midnight on final day)

threedayconsumption

Three day discharge (past midnight on final day)

threedaydischarge

@val-ismaili val-ismaili changed the title spillover for WM and DW Spillover feature for WashingMachine and Dishwasher Feb 13, 2025
Copy link
Contributor

@BramHillebrand BramHillebrand left a comment

Choose a reason for hiding this comment

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

I have noticed a few print statements ( I missed them previously). I am not sure this is a good idea. I have for instance sometimes simulated (in a loop) up to a 1000 houses for 30 days. That is potentially a lot of print statements. Is this really valuable information? We hsould consider removing them.

consumption = handle_spillover_consumption(consumption, pattern, start, end, j, ind_enduse, pattern_num, end_of_day, self.name, total_days)
elif ((day_num + 1) == total_days) and (end > end_of_day):
difference = end_of_day - start
print(difference)
Copy link
Contributor

Choose a reason for hiding this comment

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

this print statement should be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yes that's not intentionally included, was only there during development. i will remove.

@val-ismaili val-ismaili merged commit d38ca9f into master Feb 14, 2025
1 check passed
@val-ismaili val-ismaili deleted the spillover branch February 21, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete consumption and discharge events for WashingMachine and Dishwasher
2 participants