diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb2d9e856..141df04f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,6 +126,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix scheduling at Evcs with more than one Ev at a time without Em [#787](https://github.com/ie3-institute/simona/issues/787) - Fix CheckWindow duration [#921](https://github.com/ie3-institute/simona/issues/921) - Fixed ThermalStorageResults having multiple entries [#924](https://github.com/ie3-institute/simona/issues/924) +- Fix filter for thermal result checking for lastTick not for currentTick [#1008](https://github.com/ie3-institute/simona/issues/1008) - Fixed Hp results leading to overheating house and other effects [#827](https://github.com/ie3-institute/simona/issues/827) - Fixed thermal storage getting recharged when empty [#827](https://github.com/ie3-institute/simona/issues/827) diff --git a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala index a390f290b6..c37b4d1a9a 100644 --- a/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala +++ b/src/main/scala/edu/ie3/simona/agent/participant/hp/HpAgentFundamentals.scala @@ -188,7 +188,7 @@ trait HpAgentFundamentals ) val accompanyingResults = baseStateData.model.thermalGrid.results( - tick, + lastState.lastTimeTick, updatedState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) @@ -253,7 +253,7 @@ trait HpAgentFundamentals relevantData, ) val accompanyingResults = baseStateData.model.thermalGrid.results( - currentTick, + lastModelState.lastTimeTick, lastModelState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala index 9926c4aa5a..aa70a2a80c 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -643,7 +643,7 @@ final case class ThermalGrid( /** Convert the given state of the thermal grid into result models of it's * constituent models * - * @param currentTick + * @param lastTick * Actual simulation tick * @param state * State to be converted @@ -652,13 +652,13 @@ final case class ThermalGrid( * @return * A [[Seq]] of results of the constituent thermal model */ - def results(currentTick: Long, state: ThermalGridState)(implicit + def results(lastTick: Long, state: ThermalGridState)(implicit startDateTime: ZonedDateTime ): Seq[ResultEntity] = { val maybeHouseResult = house .zip(state.houseState) - .filter { case (_, state) => state.tick == currentTick } + .filter { case (_, state) => state.tick == lastTick } .map { case ( thermalHouse, @@ -674,7 +674,7 @@ final case class ThermalGrid( val maybeStorageResult = storage .zip(state.storageState) - .filter { case (_, state) => state.tick == currentTick } + .filter { case (_, state) => state.tick == lastTick } .map { case ( storage: CylindricalThermalStorage,