Skip to content

Re-grade THT game difficulty - #197

Merged
marota merged 3 commits into
ainetus:mainfrom
marota:claude/expert-op4grid-performance-t1pdrq
Jul 23, 2026
Merged

Re-grade THT game difficulty#197
marota merged 3 commits into
ainetus:mainfrom
marota:claude/expert-op4grid-performance-t1pdrq

Conversation

@marota

@marota marota commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

marota 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>
@marota
marota merged commit 1f8f76c into ainetus:main Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant