Skip to content

Commit

Permalink
Merge branch 'dev' into ms/#180-refactor-WeatherSource-and-Wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
staudtMarius authored Jul 9, 2024
2 parents b6bb91d + 8486315 commit fdef525
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed log entry after power flow calculation [#814](https://github.com/ie3-institute/simona/issues/814)
- Delete "Indices and tables" on the index page [#375](https://github.com/ie3-institute/simona/issues/375)
- Fixed provision of controllingEms within buildParticipantToActorRef [#841](https://github.com/ie3-institute/simona/issues/841)
- Simulation stopping at unhandled messages in `DBFSAlgorithm` [#821](https://github.com/ie3-institute/simona/issues/821)

## [3.0.0] - 2023-08-07

Expand Down
26 changes: 11 additions & 15 deletions src/main/scala/edu/ie3/simona/agent/grid/DBFSAlgorithm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,13 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport {
// return to Idle
idle(cleanedGridAgentBaseData)

case _ =>
// preventing "match may not be exhaustive"
Behaviors.unhandled
// handles power request that arrive to early
case (requestGridPower: RequestGridPower, _) =>
ctx.log.debug(
s"Received the message $requestGridPower too early. Stash away!"
)
buffer.stash(requestGridPower)
Behaviors.same
}
}

Expand Down Expand Up @@ -783,28 +787,20 @@ trait DBFSAlgorithm extends PowerFlowSupport with GridResultsSupport {
// happens only when we received slack data and power values before we received a request to provide grid data
// (only possible when first simulation triggered and this agent is faster in this state as the request
// by a superior grid arrives)
case (powerResponse: PowerResponse, _: GridAgentBaseData) =>
case (powerResponse: PowerResponse, _) =>
ctx.log.debug(
"Received Request for Grid Power too early. Stashing away"
)

buffer.stash(powerResponse)
Behaviors.same

// happens only when we received slack data and power values before we received a request to provide grid
// (only possible when first simulation triggered and this agent is faster
// with its power flow calculation in this state as the request by a superior grid arrives)
case (powerResponse: PowerResponse, _: PowerFlowDoneData) =>
case (requestGridPower: RequestGridPower, _) =>
ctx.log.debug(
"Received Request for Grid Power too early. Stashing away"
s"Received the message $requestGridPower too early. Stashing away!"
)

buffer.stash(powerResponse)
buffer.stash(requestGridPower)
Behaviors.same

case _ =>
// preventing "match may not be exhaustive"
Behaviors.unhandled
}
}

Expand Down

0 comments on commit fdef525

Please sign in to comment.