From 91873b90fee54e1eea045c8ef7c22e7d7aba0e0c Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Wed, 28 Aug 2024 18:11:54 +0200 Subject: [PATCH] fmt --- .../simona/model/thermal/ThermalGrid.scala | 18 +++++--- .../ie3/simona/agent/grid/ThermalGridIT.scala | 43 ++++++++++--------- 2 files changed, 33 insertions(+), 28 deletions(-) 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 236623eef4..c4323b31ae 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala @@ -1277,15 +1277,19 @@ final case class ThermalGrid( domesticHotWaterDemand.required / chargingPower if (approxDurationAtFullPower > Seconds(1)) { - val preciseChargingPower = -1 * domesticHotWaterDemand.required / (Seconds(approxDurationAtFullPower.toSeconds.toLong + 1)) - val threshold = -1 * domesticHotWaterDemand.required / preciseChargingPower + val preciseChargingPower = + -1 * domesticHotWaterDemand.required / (Seconds( + approxDurationAtFullPower.toSeconds.toLong + 1 + )) + val threshold = + -1 * domesticHotWaterDemand.required / preciseChargingPower - (preciseChargingPower, + ( + preciseChargingPower, Some( - SimpleThermalThreshold( - tick + threshold.toSeconds.toLong) - ) - ) + SimpleThermalThreshold(tick + threshold.toSeconds.toLong) + ), + ) } else { ( (-1) * domesticHotWaterDemand.required / Seconds(1d), 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 a87662ec9b..e051133200 100644 --- a/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala +++ b/src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala @@ -149,10 +149,9 @@ class ThermalGridIT ) val weatherDependentAgents = Seq(heatPumpAgent) - //TODOs + // TODOs // - check storedEnergy of domestic hot water storage for all steps - /* TICK 0 Start of Simulation House demand heating : requiredDemand = 0.0 kWh, additionalDemand ~ 15 kWh @@ -593,7 +592,7 @@ Heat pump: stays on inputModel shouldBe littleDomesticHotWaterStorageInput.getUuid time shouldBe 7220.toDateTime qDot should equalWithTolerance(0.asMegaWatt) - // energy should equalWithTolerance(0.0013698066.asMegaWattHour) + // energy should equalWithTolerance(0.0013698066.asMegaWattHour) case _ => fail( "Expected a ThermalHouseResult and a ThermalStorageResult but got something else" @@ -676,7 +675,7 @@ Heat pump: stays on inputModel shouldBe littleDomesticHotWaterStorageInput.getUuid time shouldBe 10799.toDateTime qDot should equalWithTolerance(0.asMegaWatt) - // energy should equalWithTolerance(0.001369806666.asMegaWattHour) + // energy should equalWithTolerance(0.001369806666.asMegaWattHour) case _ => fail( "Expected a ThermalHouseResult and a ThermalStorageResult but got something else" @@ -693,7 +692,7 @@ Heat pump: stays on ThermalStorage : requiredDemand = 0.0 kWh, additionalDemand = 0.0 kWh DomesticWaterStorage : tba Heat pump: stays off, demand should be covered by storage - */ + */ heatPumpAgent ! Activation(28986) @@ -714,11 +713,11 @@ Heat pump: stays on .foreach { case ResultEvent.ThermalResultEvent(thermalUnitResult) => thermalUnitResult match { case ThermalHouseResult( - time, - inputModel, - qDot, - indoorTemperature, - ) => + time, + inputModel, + qDot, + indoorTemperature, + ) => inputModel shouldBe typicalThermalHouse.getUuid time shouldBe 28800.toDateTime qDot should equalWithTolerance(0.0.asMegaWatt) @@ -727,25 +726,27 @@ Heat pump: stays on ) case CylindricalThermalStorageResult( - time, - inputModel, - qDot, - energy, - ) => + time, + inputModel, + qDot, + energy, + ) => inputModel shouldBe typicalThermalStorage.getUuid time shouldBe 28800.toDateTime qDot should equalWithTolerance(0.0.asMegaWatt) energy should equalWithTolerance(0.01044.asMegaWattHour) case DomesticHotWaterStorageResult( - time, - inputModel, - qDot, - energy, - ) => + time, + inputModel, + qDot, + energy, + ) => inputModel shouldBe littleDomesticHotWaterStorageInput.getUuid time shouldBe 28800.toDateTime qDot should equalWithTolerance((-0.011).asMegaWatt) - energy should equalWithTolerance(0.0013698066666666664.asMegaWattHour) + energy should equalWithTolerance( + 0.0013698066666666664.asMegaWattHour + ) case _ => fail( "Expected a ThermalHouseResult and a ThermalStorageResult but got something else"