docs(optimization): record the lessons of the GENETIC0 migration

Additional changes
- Correct a stale GENETIC0 docstring.
- Count infinite readings and predictions as missing in the energy-domain rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
Bobby Noelte
2026-11-27 13:55:41 +01:00
co-authored by Claude Opus 5.5
parent 40d0fab9d2
commit 8c06245e8b
11 changed files with 145 additions and 19 deletions
@@ -1,13 +1,15 @@
# Optimizers implement prepare, run and convert
Every optimizer follows the same three-step interface, so the energy management can drive any of
Every optimizer follows the same three-step interface (prepare, run, convert), so the energy management can drive any of
them the same way and every run can be replayed from its optimization parameters. The interface is
a `Protocol` generic in the optimizer's optimization parameters `P`, optimization request `Q` and
optimization result `R`, with `prepare()` and `prepare_from_request()` (asynchronous, given the run
start, the observation time, the warm start and run-time overrides), `run()` and `convert()`
(asynchronous), the latter
returning the optimization solution and the energy management plan. Its current signature is kept in one place, the
`optimizer-architecture` skill (`ai/skills/optimizer-architecture/SKILL.md`).
start, the observation time, the warm start and run-time overrides), `run()`, `convert()`
(asynchronous), which returns the optimization solution and the energy management plan, and
`api()`, which hands out the optimizer's REST router
([0011](0011-optimizer-api-visualization-and-wizard-get-no-exception.md)). Its current signature
is kept in one place, the `optimizer-architecture` skill
(`ai/skills/optimizer-architecture/SKILL.md`).
- `prepare()` is the parameter preparation. It never fails and never returns `None` (see the
`energy-domain` skill); the energy management never cancels a run because of it.