Skip to content

feat(core): implement continuous time simulation mode - #166

Open
ssossou-liege wants to merge 1 commit into
RAMP-project:mainfrom
ssossou-liege:fix/midnight-remainder
Open

ssossou-liege wants to merge 1 commit into
RAMP-project:mainfrom
ssossou-liege:fix/midnight-remainder

Conversation

@ssossou-liege

Copy link
Copy Markdown
  • Added continuous=True/False argument to UseCase.generate_daily_load_profiles().
  • Created UseCase._generate_continuous_profiles() to manage a single global timeline array, eliminating day-to-day discontinuities.
  • Implemented a new iteration architecture (users -> appliances -> days) via Appliance.generate_continuous_load_profile().
  • Added Appliance._merge_midnight_crossing_windows() to cleanly detect and merge usage windows that cross midnight (e.g., 6 PM - 6 AM becomes one continuous range instead of two isolated fragments).
  • Added Appliance._update_continuous_use() to write power values directly into the global index, allowing logical cycle spillovers past midnight.
  • Modified Appliance.rand_switch_on_window() to dynamically convert global indexes back to daily-relative indexes (% 1440) when checking compatibility against legacy duty cycle definitions.

This update physically resolves the unrealistic aggregated power drops ("edge effects") at the boundary of every 24-hour iteration (midnight) while maintaining full backward compatibility with standard, isolated day profile definitions.

Fix #Issue

Changes proposed in this pull request:

  • Your_changes

For more information on how to contribute, please check the Contributing Guidelines.

- Added `continuous=True/False` argument to `UseCase.generate_daily_load_profiles()`.
- Created `UseCase._generate_continuous_profiles()` to manage a single global timeline array, eliminating day-to-day discontinuities.
- Implemented a new iteration architecture (users -> appliances -> days) via `Appliance.generate_continuous_load_profile()`.
- Added `Appliance._merge_midnight_crossing_windows()` to cleanly detect and merge usage windows that cross midnight (e.g., 6 PM - 6 AM becomes one continuous range instead of two isolated fragments).
- Added `Appliance._update_continuous_use()` to write power values directly into the global index, allowing logical cycle spillovers past midnight.
- Modified `Appliance.rand_switch_on_window()` to dynamically convert global indexes back to daily-relative indexes (`% 1440`) when checking compatibility against legacy duty cycle definitions.

This update physically resolves the unrealistic aggregated power drops ("edge effects") at the boundary of every 24-hour iteration (midnight) while maintaining full backward compatibility with standard, isolated day profile definitions.
Copilot AI review requested due to automatic review settings May 27, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

3 participants