Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfeismann committed Aug 28, 2024
1 parent a38f814 commit 91873b9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 28 deletions.
18 changes: 11 additions & 7 deletions src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
43 changes: 22 additions & 21 deletions src/test/scala/edu/ie3/simona/agent/grid/ThermalGridIT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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"
Expand Down

0 comments on commit 91873b9

Please sign in to comment.