Skip to content

Commit

Permalink
Merge pull request #286 from ie3-institute/sp/#285-SimSchedulerSpec-e…
Browse files Browse the repository at this point in the history
…nhancement

Consolidate and enhance SimScheduler tests
  • Loading branch information
t-ober authored Aug 2, 2022
2 parents 696e571 + 63f8621 commit e7c9884
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 @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved code quality in and around DBFS algorithm [#265](https://github.com/ie3-institute/simona/issues/265)
- Adapt test to new PowerSystemUtils snapshot [#294](https://github.com/ie3-institute/simona/issues/294)
- Simplified ParticipantConfigUtil [#273](https://github.com/ie3-institute/simona/issues/273)
- 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 e7c9884

Please sign in to comment.