Re-grade THT game difficulty - #197
Merged
marota merged 3 commits intoJul 23, 2026
Merged
Conversation
added 3 commits
July 22, 2026 19:35
When a monitored line is already overloaded in the N base case (before any
contingency) and a remedial action neither influences nor clears it, the
line stays red even for a correct action — which reads as the player's
failure. compute_action_metrics already excludes such lines from
lines_overloaded_after (via build_care_mask's pre_existing & not_impacted
rule); now it also reports them as persistent_n_overloads. The action card
shows an ℹ️ bubble ('N pre-existing N overload(s) persist — not caused by
this contingency') with a tooltip listing the lines, so the player
understands they aren't counted against solving the study.
Signed-off-by: marota <amarot91@gmail.com>
The difficulty labels came from a grader that (1) never checked islanding — so a combination that islanded the overloaded line to ~0.995 was scored as 'resolved' (medium) when the app shows it still at 115% + 269 MW disconnected — and (2) excluded ALL pre-existing N overloads from the max, even ones the contingency worsened. Re-grade every candidate with the app's own compute_action_metrics (is_islanded + lines_overloaded_after via the care-mask), so the label matches what the player sees: a case is EASY/MEDIUM only if a unitary/first-combination TRULY resolves (all influenced overloads <95% monitoring, no islanding); pre-existing overloads not caused by the contingency are ignored (and surfaced separately in the action card). Also drop unplayable cases: hard scenarios where no non-islanding action or pair brings the worst monitored line below 120% (e.g. ROGNAL61SSCHA, stuck at 153% behind a pre-existing 169% overload) are removed. Net: 647 scenarios (was 656) — easy 457 / medium 80 / hard 110 — with many individual cases corrected in both directions (bad 'resolvers' demoted; cases wrongly kept hard by the old pre-existing handling promoted). Regenerates scenarios.json, per-grid graded_contingencies.json and the frontend rte7000Scenarios.json; the IIDM-1.14 networks are untouched. Signed-off-by: marota <amarot91@gmail.com>
Per review: the hard cases that stay above 100% still converge and produce real remedial actions (they're just genuinely hard), so they belong in the game rather than being culled. Remove the 120% best-achievable ceiling; a case is now excluded only if NO action converges at all (none exist in this dataset). Re-adds the 8 previously-dropped hard cases (e.g. ROGNAL61SSCHA). DB: 655 scenarios — easy 457 / medium 80 / hard 118. Regenerates scenarios.json, per-grid graded_contingencies.json and the frontend JSON; networks untouched. Signed-off-by: marota <amarot91@gmail.com>
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.
No description provided.