Skip to content

Enhanced Occupancy Model #123

Merged
s2t2 merged 2 commits intogoogle:copybara_pushfrom
amcberkes:enhanced-occupancy-model
Sep 18, 2025
Merged

Enhanced Occupancy Model #123
s2t2 merged 2 commits intogoogle:copybara_pushfrom
amcberkes:enhanced-occupancy-model

Conversation

@amcberkes
Copy link
Contributor

Added enhanced occupancy model with minute-level control and different occupant types to model weekend behaviour, included daily parameter sampling for realistic behaviour that changes from day to day. Added test file for the new occupancy model. Fixed bug in randomized_arrival_departure_occupancy.py.

Summary

This PR introduces an enhanced occupancy model that provides more realistic building occupancy simulation with the following improvements:

New Features

  • Enhanced occupancy model (smart_control/simulator/enhanced_occupancy.py):
  • Minute-level temporal control
  • Different occupant types to accurately model weekend behaviour patterns
  • Daily parameter sampling for realistic day-to-day behavioural variation
  • Tests (smart_control/simulator/enhanced_occupancy_test.py)

Bug Fixes

  • Fixed bug in randomized_arrival_departure_occupancy.py: average_zone_occupancy() returned only an instantaneous count instead of computing the true time-averaged occupancy over the specified interval

Other Changes

  • Updated GitHub issue and pull request templates

Testing

All pre-commit hooks pass, as well as the tests in enhanced_occupancy_test.py and randomized_arrival_departure_occupancy_test.py

…t occupant types to model weekend behaviour, included daily parameter sampling for realistic behaviour that changes from day to day. Added test file for the new occupancy model. Fixed bug in randomiued_arrival_departure_occupancy.py
Copy link
Collaborator

@s2t2 s2t2 left a comment

Choose a reason for hiding this comment

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

Hi @amcberkes thank you for this PR! 🙌 Looks like it will be a nice addition that will provide more complex and realistic occupancy modeling.

I left a lot of review comments.

The most important ones are:

  • a suggestion to enforce / validate the presence of timezone for the EnhancedZoneOccupant class (comment), which may also allow us to simplify some of the method signatures accordingly to accept a single timestamp parameter instead of two
  • replacing printing with logging (comment)
  • changing assertions in non-test code to error raising instead (comment)
  • fixing failing test(s) (comment)

Please feel free to reply to any of the comments if you would like to clarify or discuss further.

Otherwise let me know when you have finished implementing some updates and are ready for another review.

@amcberkes
Copy link
Contributor Author

Hi @s2t2 , thanks for the detailed review! I have pushed an updated version with your suggestions. Lmk what you think!

@s2t2 s2t2 changed the title Added enhanced occupancy model Enhanced Occupancy Model Sep 9, 2025
@s2t2 s2t2 self-requested a review September 9, 2025 15:40
Copy link
Collaborator

@s2t2 s2t2 left a comment

Choose a reason for hiding this comment

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

@amcberkes thank you for implementing the requested changes. This PR is looking good to me. And ready for merge.

FYI - there is a pipeline of incoming PRs (both internal and open source), and in hopes of minimizing merge conflicts for various contributors, I had been thinking of merging the PRs in the following order: #94 first, then #91, and then this one. However I am alternatively considering merging the PRs that are ready first. So stay tuned, but we will hope to get this merged as soon as possible.

@amcberkes
Copy link
Contributor Author

@s2t2 thanks for the update! Sounds good.

@s2t2 s2t2 merged commit d4c7bf8 into google:copybara_push Sep 18, 2025
8 of 9 checks passed
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.

2 participants