Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate and enhance SimScheduler tests #286

Merged
merged 9 commits into from
Aug 2, 2022
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