Repository navigation
Conversation
Each model's build used to fill the shared event models from its own system, so the map the emulator applied at runtime depended on build order, and its attribute ids could belong to a decision model's system. The emulator's system is the single source of truth for which outages exist. Before building any model, the simulation now fills every event model from the emulator's system with POM's discover_event_attribute_device_map; each model then applies the event to the outaged devices it has. A sequence with events and no emulation model fails the build with IS.ConflictingInputsError. Outage attributes in a decision model's own system do not affect events; they may serve other formulations, such as security-constrained ones. apply_simulation_events! looks the attributes up in the emulator's system by id and checks each has the event model's type. Because the outaged devices now come from the emulator's system, an outaged device may be one no decision model has. Event-parameter state starts at its no-outage values instead of NaN, since the emulator reads its event parameters from the decision state before any event step has written them. Event-parameter keys only the emulator has get a decision state of their own, and the event-path variable writers skip an outaged device whose variable state no model writes.
m-bossart
force-pushed
the
mb/event-lookup-by-key
branch
from
October 17, 2026 00:54
950a0a7 to
8725973
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft until Sienna-Platform/PowerOperationsModels.jl#404 merges. This PR uses it, and
[sources]pulls POM frommain, so CI fails until then.Fixes #1701.
Each model's build filled the shared event models from its own system.
The outages the emulator applied therefore depended on build order, and their attribute ids could belong to a decision model's system, so the emulator could crash or apply the wrong outage.
The emulator's system is now the single source of truth for which outages exist:
discover_event_attribute_device_map.Each model then applies the event to the outaged devices it has.
IS.ConflictingInputsError.apply_simulation_events!looks attributes up in the emulator's system by id, as before, and fails loudly if one is not of the event model's type.They may serve other formulations, such as security-constrained N-1 in a UC → RT → emulator setup.
An outaged device no longer has to be in any decision model:
NaN, since the emulator reads its event parameters from decision state before any event step writes them.OnVariable,ActivePowerVariable,TimeDurationOn/Off) skip a device whose variable state no model writes.Tests (
test/test_events.jl):rebuild_model = trueon every model, the simulation runs to completion.The full suite passes except
test_market_bid_cost.jl:388(2 failures), which also fail without this change.🤖 Generated with Claude Code