Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev' into df/#924-ThermalStorageResults-have…
Browse files Browse the repository at this point in the history
…-multiple-entries

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
danielfeismann committed Oct 14, 2024
2 parents da804f3 + c375145 commit ff62552
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve code quality in fixedloadmodelspec and other tests [#919](https://github.com/ie3-institute/simona/issues/919)
- Fix power flow calculation with em agents [#962](https://github.com/ie3-institute/simona/issues/962)
- 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)

## [3.0.0] - 2023-08-07
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import scala.concurrent.duration.DurationLong
final case class RuntimeEventLogSink(
simulationStartDate: ZonedDateTime,
log: Logger,
private var last: Long = 0L,
) extends RuntimeEventSink {

override def handleRuntimeEvent(
Expand All @@ -45,15 +44,13 @@ final case class RuntimeEventLogSink(

case CheckWindowPassed(tick, duration) =>
log.info(
s"******* Simulation until ${calcTime(tick)} completed. ${durationAndMemoryString(duration - last)} ******"
s"******* Simulation until ${calcTime(tick)} completed. ${durationAndMemoryString(duration)} ******"
)
last = duration

case Ready(tick, duration) =>
log.info(
s"******* Switched from 'Simulating' to 'Ready'. Last simulated time: ${calcTime(tick)}. ${durationAndMemoryString(duration - last)} ******"
s"******* Switched from 'Simulating' to 'Ready'. Last simulated time: ${calcTime(tick)}. ${durationAndMemoryString(duration)} ******"
)
last = duration

case Simulating(startTick, endTick) =>
log.info(
Expand Down
8 changes: 6 additions & 2 deletions src/main/scala/edu/ie3/simona/scheduler/RuntimeNotifier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ final case class RuntimeNotifier(
val completedWindows =
(adjustedLastCheck + checkWindow) to completedTick by checkWindow

completedWindows.foreach { tick =>
notify(CheckWindowPassed(tick, duration(lastStartTime, nowTime)))
completedWindows.foldLeft(lastCheckWindowTime) {
case (lastTime, tick) =>
notify(
CheckWindowPassed(tick, duration(lastTime, nowTime))
)
None
}

completedWindows.lastOption
Expand Down

0 comments on commit ff62552

Please sign in to comment.