Skip to content

Commit

Permalink
Merge branch 'df/#1008-thermalResultsFilter' into df/#878-thermalGridIT
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
danielfeismann committed Oct 29, 2024
2 parents e3807b8 + adfa724 commit 2ed6f02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,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)
- Fixed Hp results leading to overheating house and other effects [#827](https://github.com/ie3-institute/simona/issues/827)
- Fixed thermal storage getting recharged when empty [#827](https://github.com/ie3-institute/simona/issues/827)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ trait HpAgentFundamentals
)

val accompanyingResults = baseStateData.model.thermalGrid.results(
tick,
lastState.lastTimeTick,
updatedState.thermalGridState,
)(baseStateData.startDate)
val result = AccompaniedSimulationResult(power, accompanyingResults)
Expand Down Expand Up @@ -253,7 +253,7 @@ trait HpAgentFundamentals
relevantData,
)
val accompanyingResults = baseStateData.model.thermalGrid.results(
currentTick,
lastModelState.lastTimeTick,
lastModelState.thermalGridState,
)(baseStateData.startDate)
val result = AccompaniedSimulationResult(power, accompanyingResults)
Expand Down
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 @@ -643,7 +643,7 @@ final case class ThermalGrid(
/** Convert the given state of the thermal grid into result models of it's
* constituent models
*
* @param currentTick
* @param lastTick
* Actual simulation tick
* @param state
* State to be converted
Expand All @@ -652,13 +652,13 @@ final case class ThermalGrid(
* @return
* A [[Seq]] of results of the constituent thermal model
*/
def results(currentTick: Long, state: ThermalGridState)(implicit
def results(lastTick: Long, state: ThermalGridState)(implicit
startDateTime: ZonedDateTime
): Seq[ResultEntity] = {

val maybeHouseResult = house
.zip(state.houseState)
.filter { case (_, state) => state.tick == currentTick }
.filter { case (_, state) => state.tick == lastTick }
.map {
case (
thermalHouse,
Expand All @@ -674,7 +674,7 @@ final case class ThermalGrid(

val maybeStorageResult = storage
.zip(state.storageState)
.filter { case (_, state) => state.tick == currentTick }
.filter { case (_, state) => state.tick == lastTick }
.map {
case (
storage: CylindricalThermalStorage,
Expand Down

0 comments on commit 2ed6f02

Please sign in to comment.