diff --git a/CHANGELOG.md b/CHANGELOG.md index f9813ec3ce..de39ca5bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -127,6 +127,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) - Refactoring of `ThermalGrid.handleInfeed` to fix thermal storage recharge correctly when empty [#930](https://github.com/ie3-institute/simona/issues/930) ## [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 a390f290b6..e38454b020 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 7e2da343fe..be852ad189 100644 --- a/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala +++ b/src/main/scala/edu/ie3/simona/model/participant/HpModel.scala @@ -413,9 +413,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 @@ -430,7 +430,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))