Files
pumpingStation/wiki/modes
znetsixe 3e13512a83 Rename eval/ → simulations/ and fix log-write bug
Per discussion: "test" and "eval" overlap in meaning; "simulations"
is more honest about what's actually happening — scripted plant
inputs driving a physics sim, then recorded for analysis.

Rename scope:
- eval/ → simulations/ (tracked as git renames)
- Internal references in run.js and README.md updated
- wiki/modes/mpc.md link updated

Also fixes a log-write bug noticed during the rename:
- run.js didn't mkdir simulations/logs/ before createWriteStream,
  so the stream opened into a potentially non-existent dir and the
  file never materialised. Added fs.mkdirSync(..., recursive:true).
- end() wasn't awaited, so the process could exit before the stream
  flushed. Now awaits the 'finish' event. Confirmed: 1200 records
  actually land in simulations/logs/<scenario>.jsonl.
- Added simulations/logs/.gitignore so future JSONL artefacts stay
  out of the repo but the dir remains tracked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 17:46:10 +02:00
..

Control modes

Each page describes one pumpingStation control mode and how it uses the shared basin model — specifically, how it uses the three control thresholds (minLevel, startLevel, maxLevel) and computes the demand it sends to the MGC.

The two safety thresholds (dryRunLevel and overflowLevel) are mode-independent and are enforced by the safety layer outside any mode. They never appear in a mode's policy.

Template

Every mode page follows the same structure:

  1. At a glance — one sentence + small fact table (inputs, output, status)
  2. Diagram — one or more, per tier (see below)
  3. Inputs — what signals the mode reads
  4. Threshold policy — how it uses / adjusts minLevel, startLevel, maxLevel
  5. Demand formula — pseudocode for Tier 1/2, objective function for Tier 3
  6. Edge cases — cold start, sensor dropout, interaction with safety layer
  7. Related — links to other modes + functional description

The three tiers classify modes by how dynamic the decision surface is:

Tier Curve Example modes Diagram type
1 — static Memoryless demand = f(x); single curve levelbased, manual Single-curve transfer function
2 — parameterised Shape fixed, curve moves with θ(t) flowbased, pressureBased, percentageBased, powerBased Transfer function + parameter overlay / family
3 — horizon-based Optimisation, no fixed curve hybrid-optimal, mpc, weather-aware Block diagram of signal flow + scenario time-series

Implementation status

Mode Tier Status Page
levelbased 1 implemented levelbased.md
manual 1 implemented (via Qd topic)
flowbased 2 🚧 code placeholder, template flowbased.md
pressureBased 2 🚧 code placeholder
percentageBased 2 🚧 code placeholder
powerBased 2 🚧 code placeholder, template powerbased.md
hybrid 3 🚧 code placeholder
mpc 3 🚧 not in code yet, template mpc.md