Skip to content

Commit

Permalink
edge case continue heating till target temperature when surplus energ…
Browse files Browse the repository at this point in the history
…y is dropping
  • Loading branch information
danielfeismann committed Feb 12, 2025
1 parent cb1b874 commit f5d89b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/edu/ie3/simona/model/thermal/ThermalGrid.scala
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ final case class ThermalGrid(

// We can use the qDots from lastState to keep continuity. If...
if (
// ... house was heated in lastState but not from Storage and has still some demand.
((qDotHouseLastState > zeroKW && (qDotStorageLastState >= zeroKW) && thermalDemands.houseDemand.hasAdditionalDemand) ||
// ... house was heated in lastState but not from Storage and has still some demand. Hp must still run for this.
((qDotHouseLastState > zeroKW && (qDotStorageLastState >= zeroKW) && thermalDemands.houseDemand.hasAdditionalDemand) && isRunning ||
// ... storage was filled up in the lastState and has still additional demand
// But only if the house not reached some requiredDemand.
qDotStorageLastState > zeroKW && thermalDemands.heatStorageDemand.hasAdditionalDemand && !thermalDemands.houseDemand.hasRequiredDemand)
// But only if the house not reached some requiredDemand. Hp must still run for this.
qDotStorageLastState > zeroKW && thermalDemands.heatStorageDemand.hasAdditionalDemand && !thermalDemands.houseDemand.hasRequiredDemand && isRunning)
) {
// We can continue for the house
val (updatedHouseState, thermalHouseThreshold, remainingQDotHouse) =
Expand Down

0 comments on commit f5d89b5

Please sign in to comment.