The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Experience Database — README
Overview
rl_experience.db and rl_experience_test.db are SQLite databases that serve as
persistent caches for the RL training pipeline (rl_experience_store.py). Each
row stores the result of one RL transition — a unique
(scenario_id, previous_lines, action_line_index) triple — including its
dynamic-impact severity (R_D, computed via Dynawo), relaxed-OPF severity (R_O,
computed via IPOPT), and the resulting state feature vector. Computing one such
triple takes ~2–3 s for R_D and ~0.3–0.5 s for R_O; the database means each
triple is computed exactly once and then served from disk forever, across all
processes and training runs.
alpha is deliberately not stored. Because R_total = alpha * R_D + (1 - alpha) * R_O,
any blend can be recomputed at query time from the cached R_D/R_O pair with no
re-simulation.
Files
| File | Role | Scenario IDs |
|---|---|---|
rl_experience.db |
Training cache | 0 – 299 (random dispatch seeds) |
rl_experience_test.db |
Held-out evaluation cache | 10 000 – 10 099 (never seen during training) |
Schema
Both databases share the same two-table schema.
transitions (primary table)
Each row is one cached (scenario, prefix, action) triple.
| Column | Type | Description |
|---|---|---|
scenario_id |
INTEGER | Dispatch seed passed to DispatchGenerator(seed=scenario_id) |
previous_lines |
TEXT | Comma-separated line indices already tripped before this action (empty string "" for depth-0 / first fault) |
action_line_index |
INTEGER | The pandapower line index tripped at this step |
step |
INTEGER | Cascade depth of this action (0 = first fault, 1 = second, 2 = third) |
R_D |
REAL | Dynamic-impact severity from Dynawo transient simulation. Set to 5000.0 if Dynawo or the pre-fault power flow fails to converge |
R_D_max |
REAL | Simulation time horizon T used as the normalisation denominator in R_D |
T |
REAL | Full simulation window length (seconds) |
fault_t_end |
REAL | Time at which the fault is cleared (seconds) |
gen_detail_json |
TEXT | JSON dict of per-generator angular deviation and disconnection details from the Dynawo curves |
R_O |
REAL | Relaxed-OPF objective value (operational severity). Set to 5000.0 if the OPF returns no solution |
opf_detail_json |
TEXT | JSON dict with OPF metrics: gen_dispatch_change, voltage_violations, gen_violations, branch_violations, load_shed_p/q, total_violations, objective_value, infeasible |
state_features_json |
TEXT | JSON dict of the post-action state feature vector (bus voltages, line loadings, etc.) computed by rl_state_features.compute_state_features after tripping all lines in previous_lines + [action_line_index] |
computed_at |
TEXT | ISO-8601 timestamp of when this row was first inserted |
Primary key: (scenario_id, previous_lines, action_line_index)
knn_sources (auxiliary table)
Marks which transitions were collected by a purely random policy and are
therefore unbiased samples suitable for KNN baseline training. A triple can be
tagged without re-computing anything — the actual data lives in transitions.
| Column | Type | Description |
|---|---|---|
scenario_id |
INTEGER | Same key as transitions |
previous_lines |
TEXT | Same key as transitions |
action_line_index |
INTEGER | Same key as transitions |
run_tag |
TEXT | Label for the collection run (default "random") |
Primary key: (scenario_id, previous_lines, action_line_index)
Contents
rl_experience.db (training)
| Metric | Value |
|---|---|
| Total transitions | 19 801 |
| Distinct scenarios | 298 |
| KNN-tagged transitions | 3 427 |
| Depth-0 transitions (first fault) | 2 699 |
| Depth-1 transitions (second fault) | 6 382 |
| Depth-2 transitions (third fault) | 10 720 |
rl_experience_test.db (evaluation)
| Metric | Value |
|---|---|
| Total transitions | 11 469 |
| Distinct scenarios | 100 |
| KNN-tagged transitions | 0 (evaluation only — never used for KNN training) |
| Depth-0 transitions | 1 551 |
| Depth-1 transitions | 3 539 |
| Depth-2 transitions | 5 994 |
| Depth-3 transitions | 385 |
Failure handling
When Dynawo's transient solver or pandapower's pre-fault power flow diverges,
R_D is set to 5000.0 (DYNAWO_FAILURE_R_D) rather than being skipped or
zeroed. Similarly, OPF failures set R_O = 5000.0 (OPF_FAILURE_R_O). Both
values are deliberately above the largest organically observed rewards
(R_D ≈ 1 856, R_O ≈ 80–100) so that divergence is treated as the
most severe outcome, not a data gap. The gen_detail_json or opf_detail_json
fields of such rows contain {"diverged": true, "error": "<message>"}.
Usage
from rl_experience_store import ExperienceStore
store = ExperienceStore(db_path="rl_experience.db")
# Cache-first lookup (computes and stores on a miss)
record = store.get_or_compute(
scenario_id=5,
net=net, # solved pandapower network
previous_lines=[138], # lines already tripped
action_line_index=60, # line to trip now
)
# Alpha-blend at query time (no re-simulation)
r_d, r_o, r_total = store.reward(record, alpha=0.7)
# Direct read (returns None on a miss)
record = store.get(scenario_id=5, previous_lines=[138], action_line_index=60)
Notes
- Both databases are append-only in normal use.
INSERT OR REPLACEis used on write, so re-running a scenario with the same triple overwrites the old row. - The
rl_experience_test.dbscenario IDs start at 10 000 to ensure strict separation from the training pool (IDs 0–299). - The
knn_sourcestable inrl_experience_test.dbis empty by design — test transitions are never used to train the KNN baseline. - State features are stored post-action (after all outages in
previous_lines + [action_line_index]are applied), reflecting the network state the agent will observe at the next step.
- Downloads last month
- 8