Skip to content

Commit

Permalink
Merge branch 'sp/#285-SimSchedulerSpec-enhancement' into sp/#282-SimS…
Browse files Browse the repository at this point in the history
…cheduler-data-structures
  • Loading branch information
sebastian-peter committed Jul 18, 2022
2 parents 984fc22 + 57ae3fd commit f140a73
Show file tree
Hide file tree
Showing 4 changed files with 915 additions and 1,291 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adapt to new simonaAPI snapshot [#95](https://github.com/ie3-institute/simona/issues/95)
- Update Sphinx to 4.5.0 as well as extensions [#214](https://github.com/ie3-institute/simona/issues/214)
- Improved code quality in and around DBFS algorithm [#265](https://github.com/ie3-institute/simona/issues/265)
- Consolidated and enhanced SimScheduler tests [#285](https://github.com/ie3-institute/simona/issues/285)

### Fixed
- Location of `vn_simona` test grid (was partially in Berlin and Dortmund) [#72](https://github.com/ie3-institute/simona/issues/72)
Expand Down
15 changes: 12 additions & 3 deletions src/main/scala/edu/ie3/simona/scheduler/SimScheduler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ class SimScheduler(
case PowerFlowFailedMessage =>
/* config dependant we either go into onErrorReceive and terminate when we have
* all completion messages received or we just go on with the normal schedule*/
val updateStateData = stateData.copy(
val updatedStateData = stateData.copy(
runtime = stateData.runtime
.copy(noOfFailedPF = stateData.runtime.noOfFailedPF + 1)
)
if (stopOnFailedPowerFlow) {
/* go to onError receive state */
context become schedulerReceiveOnError(updateStateData)
context become schedulerReceiveOnError(updatedStateData)
} else {
context become schedulerReceive(updateStateData)
context become schedulerReceive(updatedStateData)
}

/* received whenever a watched agent dies */
Expand Down Expand Up @@ -199,6 +199,15 @@ class SimScheduler(

context become schedulerReceiveOnError(updatedStateData)

case PowerFlowFailedMessage =>
/* config dependant we either go into onErrorReceive and terminate when we have
* all completion messages received or we just go on with the normal schedule*/
val updatedStateData = stateData.copy(
runtime = stateData.runtime
.copy(noOfFailedPF = stateData.runtime.noOfFailedPF + 1)
)
context become schedulerReceiveOnError(updatedStateData)

/* all unhandled messages */
case unhandledMessage =>
log.error(
Expand Down
Loading

0 comments on commit f140a73

Please sign in to comment.