Skip to content

Commit

Permalink
Fix activation of Hp when not under control of an EM
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfeismann committed Aug 24, 2024
1 parent f82a8c3 commit ec4ef6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed FixedFeedModelSpec [#861](https://github.com/ie3-institute/simona/issues/861)
- Fixing duration calculation in result events [#801](https://github.com/ie3-institute/simona/issues/801)
- Handle MobSim requests for current prices [#892](https://github.com/ie3-institute/simona/issues/892)
- Fix activation of Hp when not under control of an EM [#922](https://github.com/ie3-institute/simona/issues/922)

## [3.0.0] - 2023-08-07

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,26 @@ trait HpAgentFundamentals
currentTick,
updatedState,
)
val updatedBaseStateData =
baseStateData.copy(stateDataStore = updatedStateDataStore)

val updatedBaseStateData = {
updatedState.maybeThermalThreshold match {
case Some(nextThreshold)
if baseStateData.foreseenDataTicks.headOption.exists {
case (_, Some(tick)) => nextThreshold.tick < tick
case _ => false
} =>
baseStateData.copy(
stateDataStore = updatedStateDataStore,
additionalActivationTicks =
baseStateData.additionalActivationTicks + nextThreshold.tick,
)
case _ =>
baseStateData.copy(
stateDataStore = updatedStateDataStore
)
}
}

updateValueStoresInformListenersAndGoToIdleWithUpdatedBaseStateData(
scheduler,
updatedBaseStateData,
Expand Down

0 comments on commit ec4ef6c

Please sign in to comment.