diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e7c57936..d05cd57996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -151,6 +151,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactor external simulation setup [#1136](https://github.com/ie3-institute/simona/issues/1136) - Use new tick retrieval methods from PSDM [#920](https://github.com/ie3-institute/simona/issues/920) - Refactor input and output configs [#1175](https://github.com/ie3-institute/simona/issues/1175) +- Use `Math.floor` when calcNextEventTick for charging entities [#1256](https://github.com/ie3-institute/simona/issues/1256) ### Fixed - Fix rendering of references in documentation [#505](https://github.com/ie3-institute/simona/issues/505) diff --git a/src/main/scala/edu/ie3/simona/model/participant2/ChargingHelper.scala b/src/main/scala/edu/ie3/simona/model/participant2/ChargingHelper.scala index 90192c587f..bd62b5b439 100644 --- a/src/main/scala/edu/ie3/simona/model/participant2/ChargingHelper.scala +++ b/src/main/scala/edu/ie3/simona/model/participant2/ChargingHelper.scala @@ -96,7 +96,7 @@ object ChargingHelper { // calculate the tick from time span maybeTimeSpan.map { timeSpan => - val timeSpanTicks = Math.round(timeSpan.toSeconds) + val timeSpanTicks = Math.floor(timeSpan.toSeconds).toLong currentTick + timeSpanTicks } } diff --git a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala index a3a4db1d6a..abd9f8e5cc 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorage.scala @@ -106,14 +106,14 @@ final case class CylindricalThermalStorage( val nextThreshold = if (qDot > zeroKW) { val duration = (maxEnergyThreshold - updatedEnergy) / qDot - val durationInTicks = Math.round(duration.toSeconds) + val durationInTicks = Math.floor(duration.toSeconds).toLong if (durationInTicks <= 0L) None else Some(StorageFull(tick + durationInTicks)) } else if (qDot < zeroKW) { val duration = updatedEnergy / qDot * (-1) - val durationInTicks = Math.round(duration.toSeconds) + val durationInTicks = Math.floor(duration.toSeconds).toLong if (durationInTicks <= 0L) None else diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala index e01c2bb8e8..2392115084 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -336,9 +336,11 @@ final case class ThermalHouse( if (flexibleEnergy < zeroMWh) None else { - val duration = Math.round( - (flexibleEnergy / (qDot * math.signum(qDot.toWatts))).toSeconds - ) + val duration = Math + .floor( + (flexibleEnergy / (qDot * math.signum(qDot.toWatts))).toSeconds + ) + .toLong Some(tick + duration) } } diff --git a/src/test/scala/edu/ie3/simona/agent/em/EmAgentIT.scala b/src/test/scala/edu/ie3/simona/agent/em/EmAgentIT.scala index 9d7f074628..142fe65035 100644 --- a/src/test/scala/edu/ie3/simona/agent/em/EmAgentIT.scala +++ b/src/test/scala/edu/ie3/simona/agent/em/EmAgentIT.scala @@ -286,9 +286,9 @@ class EmAgentIT emResult.getQ should equalWithTolerance(0.0000882855367.asMegaVar) } - scheduler.expectMessage(Completion(emAgentActivation, Some(13247))) + scheduler.expectMessage(Completion(emAgentActivation, Some(13246))) - /* TICK 13247 + /* TICK 13246 LOAD: 0.269 kW (unchanged) PV: -3.715 kW (unchanged) STORAGE: SOC 100 % @@ -296,12 +296,12 @@ class EmAgentIT -> remaining -3.447 kW */ - emAgentActivation ! Activation(13247) + emAgentActivation ! Activation(13246) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(emResult: EmResult) => emResult.getInputModel shouldBe emInput.getUuid - emResult.getTime shouldBe 13247.toDateTime + emResult.getTime shouldBe 13246.toDateTime emResult.getP should equalWithTolerance( -0.0034468567291.asMegaWatt ) diff --git a/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala b/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala index 83cdba41f7..45fa95ab47 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala @@ -217,21 +217,21 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(3417))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(3416))) - /* TICK 3417 + /* TICK 3416 Storage is fully heated up House demand heating : requiredDemand = 0.0 kWh, possibleDemand = 17.37 kWh ThermalStorage : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh Heat pump: stays on since it was on and the house has possible demand */ - heatPumpAgent ! Activation(3417) + heatPumpAgent ! Activation(3416) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 3417.toDateTime + hpResult.getTime shouldBe 3416.toDateTime hpResult.getP should equalWithTolerance(pRunningHp) hpResult.getQ should equalWithTolerance( qRunningHp @@ -251,10 +251,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 3417.toDateTime + time shouldBe 3416.toDateTime qDot should equalWithTolerance(0.011.asMegaWatt) indoorTemperature should equalWithTolerance( - 19.6835196903292.asDegreeCelsius + 19.683612282578906.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -264,7 +264,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 3417.toDateTime + time shouldBe 3416.toDateTime qDot should equalWithTolerance(0.asMegaWatt) energy should equalWithTolerance(0.01044.asMegaWattHour) case _ => @@ -325,7 +325,7 @@ class ThermalGridIT time shouldBe 7200.toDateTime qDot should equalWithTolerance(0.011.asMegaWatt) indoorTemperature should equalWithTolerance( - 20.8788983755569.asDegreeCelsius + 20.8793056571075.asDegreeCelsius ) case CylindricalThermalStorageResult( time, @@ -344,21 +344,21 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(10798))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(10797))) - /* TICK 10798 + /* TICK 10797 House reaches upper temperature boundary House demand heating : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh ThermalStorage : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh Heat pump: turned off */ - heatPumpAgent ! Activation(10798) + heatPumpAgent ! Activation(10797) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 10798.toDateTime + hpResult.getTime shouldBe 10797.toDateTime hpResult.getP should equalWithTolerance(0.asMegaWatt) hpResult.getQ should equalWithTolerance(0.asMegaVar) } @@ -376,10 +376,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 10798.toDateTime + time shouldBe 10797.toDateTime qDot should equalWithTolerance(0.asMegaWatt) indoorTemperature should equalWithTolerance( - 21.9998899446115.asDegreeCelsius + 21.9999802406311.asDegreeCelsius ) case CylindricalThermalStorageResult( time, @@ -388,7 +388,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 10798.toDateTime + time shouldBe 10797.toDateTime qDot should equalWithTolerance(0.asMegaWatt) energy should equalWithTolerance(0.01044.asMegaWattHour) case _ => @@ -401,7 +401,7 @@ class ThermalGridIT scheduler.expectMessage(Completion(heatPumpAgent, Some(28800))) /* TICK 28800 - House would reach lowerTempBoundary at tick 50797 + House would reach lowerTempBoundary at tick 50797, but now it's getting colder which should decrease inner temp of house faster House demand heating : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh ThermalStorage : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh @@ -448,7 +448,7 @@ class ThermalGridIT time shouldBe 28800.toDateTime qDot should equalWithTolerance(0.0.asMegaWatt) indoorTemperature should equalWithTolerance( - 20.19969728245267.asDegreeCelsius + 20.1996815581419.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -468,21 +468,21 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(41940))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(41939))) - /* TICK 41940 + /* TICK 41939 House reach lowerTemperatureBoundary House demand heating : requiredDemand = 15.0 kWh, possibleDemand = 30.00 kWh ThermalStorage : requiredDemand = 0.0 kWh, possibleDemand = 0.0 kWh Heat pump: stays off, demand should be covered by storage */ - heatPumpAgent ! Activation(41940) + heatPumpAgent ! Activation(41939) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 41940.toDateTime + hpResult.getTime shouldBe 41939.toDateTime hpResult.getP should equalWithTolerance(0.0.asMegaWatt) hpResult.getQ should equalWithTolerance(0.0.asMegaVar) } @@ -500,10 +500,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 41940.toDateTime + time shouldBe 41939.toDateTime qDot should equalWithTolerance(0.01044.asMegaWatt) indoorTemperature should equalWithTolerance( - 17.9999786813733.asDegreeCelsius + 18.00013112854035.asDegreeCelsius ) case CylindricalThermalStorageResult( time, @@ -512,7 +512,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 41940.toDateTime + time shouldBe 41939.toDateTime qDot should equalWithTolerance(-0.01044.asMegaWatt) energy should equalWithTolerance(0.01044.asMegaWattHour) case _ => @@ -572,7 +572,7 @@ class ThermalGridIT time shouldBe 45000.toDateTime qDot should equalWithTolerance(0.01044.asMegaWatt) indoorTemperature should equalWithTolerance( - 18.69584558965105.asDegreeCelsius + 18.6962237160053.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -585,7 +585,7 @@ class ThermalGridIT time shouldBe 45000.toDateTime qDot should equalWithTolerance(-0.01044.asMegaWatt) energy should equalWithTolerance( - 0.00156599999999999.asMegaWattHour + 0.0015631.asMegaWattHour ) case _ => fail( @@ -594,9 +594,9 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(45540))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(45539))) - /* TICK 45540 + /* TICK 45539 Storage will be empty House demand heating : requiredDemand = 8.87kWh, possibleDemand = 23.87 kWh ThermalStorage : requiredDemand = 10.44 kWh, possibleDemand = 10.44 kWh @@ -604,12 +604,12 @@ class ThermalGridIT Heat pump: will be turned on - to serve the remaining heat demand of house (and refill storage later) */ - heatPumpAgent ! Activation(45540) + heatPumpAgent ! Activation(45539) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 45540.toDateTime + hpResult.getTime shouldBe 45539.toDateTime hpResult.getP should equalWithTolerance(pRunningHp) hpResult.getQ should equalWithTolerance(qRunningHp) } @@ -627,10 +627,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 45540.toDateTime + time shouldBe 45539.toDateTime qDot should equalWithTolerance(0.011.asMegaWatt) indoorTemperature should equalWithTolerance( - 18.81725389847177.asDegreeCelsius + 18.8174064397722.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -640,7 +640,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 45540.toDateTime + time shouldBe 45539.toDateTime qDot should equalWithTolerance(0.asMegaWatt) energy should equalWithTolerance(0.asMegaWattHour) case _ => @@ -699,7 +699,7 @@ class ThermalGridIT time shouldBe 57600.toDateTime qDot should equalWithTolerance(0.011.asMegaWatt) indoorTemperature should equalWithTolerance( - 21.77341655767336.asDegreeCelsius + 21.77380740617926.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -715,21 +715,21 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(58256))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(58255))) - /* TICK 58256 + /* TICK 58255 House will reach the upperTemperatureBoundary House demand heating : requiredDemand = 0.00 kWh, possibleDemand = 0.00 kWh ThermalStorage : requiredDemand = 10.44 kWh, possibleDemand = 10.44 kWh Heat pump: stays on to refill the storage now */ - heatPumpAgent ! Activation(58256) + heatPumpAgent ! Activation(58255) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 58256.toDateTime + hpResult.getTime shouldBe 58255.toDateTime hpResult.getP should equalWithTolerance(pRunningHp) hpResult.getQ should equalWithTolerance(qRunningHp) } @@ -747,10 +747,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 58256.toDateTime + time shouldBe 58255.toDateTime qDot should equalWithTolerance(0.asMegaWatt) indoorTemperature should equalWithTolerance( - 21.999922627074.asDegreeCelsius + 21.999967243768.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -760,7 +760,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 58256.toDateTime + time shouldBe 58255.toDateTime qDot should equalWithTolerance(0.011.asMegaWatt) energy should equalWithTolerance( 0.asMegaWattHour @@ -768,21 +768,21 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(61673))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(61671))) - /* TICK 61673 + /* TICK 61671 Storage will be fully charged House demand heating : requiredDemand = 0.00 kWh, possibleDemand = 0.00 kWh ThermalStorage : requiredDemand = 0.00 kWh, possibleDemand = 0.00 kWh Heat pump: turned off */ - heatPumpAgent ! Activation(61673) + heatPumpAgent ! Activation(61671) resultListener.expectMessageType[ParticipantResultEvent] match { case ParticipantResultEvent(hpResult) => hpResult.getInputModel shouldBe typicalHpInputModel.getUuid - hpResult.getTime shouldBe 61673.toDateTime + hpResult.getTime shouldBe 61671.toDateTime hpResult.getP should equalWithTolerance(0.asMegaWatt) hpResult.getQ should equalWithTolerance(0.asMegaVar) } @@ -800,10 +800,10 @@ class ThermalGridIT indoorTemperature, ) => inputModel shouldBe typicalThermalHouse.getUuid - time shouldBe 61673.toDateTime + time shouldBe 61671.toDateTime qDot should equalWithTolerance(0.asMegaWatt) indoorTemperature should equalWithTolerance( - 21.7847791618269.asDegreeCelsius + 21.7848861767135.asDegreeCelsius ) case CylindricalThermalStorageResult( @@ -813,7 +813,7 @@ class ThermalGridIT energy, ) => inputModel shouldBe typicalThermalStorage.getUuid - time shouldBe 61673.toDateTime + time shouldBe 61671.toDateTime qDot should equalWithTolerance(0.asMegaWatt) energy should equalWithTolerance( 0.01044.asMegaWattHour @@ -821,7 +821,7 @@ class ThermalGridIT } } - scheduler.expectMessage(Completion(heatPumpAgent, Some(122555))) + scheduler.expectMessage(Completion(heatPumpAgent, Some(122554))) } } diff --git a/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala index ee6b162a2a..d1742eee97 100644 --- a/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant/HpModelSpec.scala @@ -55,7 +55,7 @@ class HpModelSpec true, 95, 15.6, - Some(HouseTemperatureTargetOrUpperBoundaryReached(31711)), + Some(HouseTemperatureTargetOrUpperBoundaryReached(31710)), ), ( HpState( @@ -70,7 +70,7 @@ class HpModelSpec true, 95, 16.4, - Some(HouseTemperatureTargetOrUpperBoundaryReached(30642)), + Some(HouseTemperatureTargetOrUpperBoundaryReached(30641)), ), ( HpState( @@ -115,7 +115,7 @@ class HpModelSpec false, 0, 20.4, - Some(HouseTemperatureLowerBoundaryReached(15508)), + Some(HouseTemperatureLowerBoundaryReached(15507)), ), ( HpState( @@ -130,7 +130,7 @@ class HpModelSpec false, 0, 31.6, - Some(HouseTemperatureLowerBoundaryReached(29867)), + Some(HouseTemperatureLowerBoundaryReached(29866)), ), ( HpState( @@ -145,7 +145,7 @@ class HpModelSpec false, 0, 32.4, - Some(HouseTemperatureLowerBoundaryReached(30343)), + Some(HouseTemperatureLowerBoundaryReached(30342)), ), ( HpState( diff --git a/src/test/scala/edu/ie3/simona/model/participant2/StorageModelSpec.scala b/src/test/scala/edu/ie3/simona/model/participant2/StorageModelSpec.scala index 3807df288b..2439f56242 100644 --- a/src/test/scala/edu/ie3/simona/model/participant2/StorageModelSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/participant2/StorageModelSpec.scala @@ -441,7 +441,7 @@ class StorageModelSpec extends UnitSpec with Matchers { operatingPoint.activePower should approximate(Kilowatts(-9d)) changeIndicator.changesAtTick should be( - Some(tick + 10801L) + Some(tick + 10800L) ) changeIndicator.changesAtNextActivation shouldBe true } @@ -465,7 +465,7 @@ class StorageModelSpec extends UnitSpec with Matchers { operatingPoint.activePower should approximate(Kilowatts(5d)) changeIndicator.changesAtTick should be( - Some(tick + 48002L) + Some(tick + 48001L) ) changeIndicator.changesAtNextActivation shouldBe true } diff --git a/src/test/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorageSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorageSpec.scala index 556f6da7ee..1dc715b24d 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/CylindricalThermalStorageSpec.scala @@ -141,7 +141,7 @@ class CylindricalThermalStorageSpec 3600L, 42.0, 260.0, - ThermalStorage.ThermalStorageThreshold.StorageFull(79886L), + ThermalStorage.ThermalStorageThreshold.StorageFull(79885L), ), ( 0L, @@ -173,10 +173,10 @@ class CylindricalThermalStorageSpec ( 0L, 1000.0, - 149.0, + 148.6, 3600L, 5000.0, - 1149.0, + 1148.6, ThermalStorage.ThermalStorageThreshold.StorageFull(3601L), ), ( @@ -184,7 +184,7 @@ class CylindricalThermalStorageSpec 10.0, -9.0, 3600L, - -5000.0, + -3600.0, 1.0, ThermalStorage.ThermalStorageThreshold.StorageEmpty(3601L), ), diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala index 698bc5d598..2479b97973 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseAndStorageSpec.scala @@ -213,7 +213,7 @@ class ThermalGridWithHouseAndStorageSpec case _ => fail("Thermal grid state has been calculated wrong.") } reachedThreshold shouldBe Some( - HouseTemperatureLowerBoundaryReached(154285L) + HouseTemperatureLowerBoundaryReached(154284L) ) } @@ -257,7 +257,7 @@ class ThermalGridWithHouseAndStorageSpec qDotStorage should approximate(externalQDot) case _ => fail("Thermal grid state has been calculated wrong.") } - reachedThreshold shouldBe Some(StorageEmpty(17143L)) + reachedThreshold shouldBe Some(StorageEmpty(17142L)) } } @@ -512,7 +512,7 @@ class ThermalGridWithHouseAndStorageSpec thermalStorage.pThermalMax * (-1) ) - houseWarmTick shouldBe 13825L + houseWarmTick shouldBe 13824L storageEmptyTick shouldBe 10145L case _ => fail("Revision of states failed") } diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala index e1297fb6d0..a638ca60f1 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalGridWithHouseOnlySpec.scala @@ -149,7 +149,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { case _ => fail("Thermal grid state has been calculated wrong.") } reachedThreshold shouldBe Some( - HouseTemperatureLowerBoundaryReached(154285L) + HouseTemperatureLowerBoundaryReached(154284L) ) } @@ -179,7 +179,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { case _ => fail("Thermal grid state has been calculated wrong.") } reachedThreshold shouldBe Some( - HouseTemperatureLowerBoundaryReached(154285L) + HouseTemperatureLowerBoundaryReached(154284L) ) } } @@ -271,7 +271,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) qDot should approximate(zeroKW) - thresholdTick shouldBe 154285L + thresholdTick shouldBe 154284L case _ => fail("Thermal grid state updated failed") } } @@ -295,7 +295,7 @@ class ThermalGridWithHouseOnlySpec extends UnitSpec with ThermalHouseTestData { tick shouldBe 0L innerTemperature should approximate(Celsius(18.9999d)) qDot should approximate(zeroKW) - thresholdTick shouldBe 154285L + thresholdTick shouldBe 154284L case _ => fail("Thermal grid state updated failed") } } diff --git a/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseSpec.scala b/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseSpec.scala index a02b875189..bae4988bf8 100644 --- a/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/thermal/ThermalHouseSpec.scala @@ -93,7 +93,7 @@ class ThermalHouseSpec extends UnitSpec with HpInputTestData { case unexpected => fail(s"Expected a thermalHouseState but got none $unexpected.") } - threshold shouldBe Some(HouseTemperatureLowerBoundaryReached(4967)) + threshold shouldBe Some(HouseTemperatureLowerBoundaryReached(4966)) } "Check build method" in {