diff --git a/CHANGELOG.md b/CHANGELOG.md index 33098b858f..223be89be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,6 +125,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) ## [3.0.0] - 2023-08-07 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 b95d25671d..9094058deb 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, + updatedState.tick, updatedState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) @@ -253,8 +253,8 @@ trait HpAgentFundamentals relevantData, ) val accompanyingResults = baseStateData.model.thermalGrid.results( - currentTick, - lastModelState.thermalGridState, + updatedState.tick, + updatedState.thermalGridState, )(baseStateData.startDate) val result = AccompaniedSimulationResult(power, accompanyingResults) diff --git a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala index 4d9fc68899..37cd4b1a8e 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -325,9 +325,9 @@ object HpModel { * temperature. * * @param isRunning - * indicates if CHP is turned on - * @param lastTimeTick - * contains last time tick + * indicates if HP is turned on + * @param tick + * the time tick of the HpState * @param ambientTemperature * Optional ambient temperature, if available * @param activePower @@ -342,7 +342,7 @@ object HpModel { */ final case class HpState( isRunning: Boolean, - lastTimeTick: Long, + tick: Long, ambientTemperature: Option[Temperature], activePower: Power, qDot: Power, diff --git a/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala b/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala index 3ff4229ab7..03007b225a 100644 --- a/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/participant/HpAgentModelCalculationSpec.scala @@ -506,7 +506,7 @@ class HpAgentModelCalculationSpec _, HpState( isRunning, - lastTimeTick, + tick, _, activePower, qDot, @@ -516,7 +516,7 @@ class HpAgentModelCalculationSpec ) ) => isRunning shouldBe false - lastTimeTick shouldBe 0L + tick shouldBe 0L activePower should approximate(Kilowatts(0.0)) qDot should approximate(Kilowatts(0.0)) @@ -634,7 +634,7 @@ class HpAgentModelCalculationSpec _, HpState( isRunning, - lastTimeTick, + tick, _, activePower, qDot, @@ -644,7 +644,7 @@ class HpAgentModelCalculationSpec ) ) => isRunning shouldBe false - lastTimeTick shouldBe 0L + tick shouldBe 0L activePower should approximate(Kilowatts(0d)) qDot should approximate(Kilowatts(0d))