What is wrong
core/simulator/core.py:79:
plant = BatteryPack(bp, tp, thp, elp, pp) if use_pack else BatteryPlant(bp, tp, thp, elp)
Two plant models, one if. The choice is a boolean derived from whether pp (PackParams) was passed (core.py:77-80), so "which plant" is encoded as "which optional argument is not None". A third model — a different chemistry, a reduced-order surrogate for fast sweeps, a degradation-aware plant for v9 — is another branch in the loop and another optional parameter on run_simulation.
The two classes already share an implicit contract the loop relies on: step(...), get_measurement(), get_state(), reset() (core/physics/plant.py:520-706 and :811-952). Nothing names it.
What it should be
Same shape as the estimator seam (#2) and the strategy seam that already works:
- A
PlantLike Protocol owned by the harness (this is devkit code — a real battery is the plant).
- The concrete plant chosen where the experiment is composed, never in the loop.
n_cells and any pack-only trace shape (SimTraces(n_cells=…), core.py:80,92) become facts the plant reports about itself, not values the loop derives from a flag.
- A registry with provenance, so a plant enters as a name.
Done when
- The loop constructs no plant; it receives one.
- Adding a plant model is one file plus a registry line.
- Proof: both existing plants produce bit-identical traces before and after.
Phase 1 of the platform epic. Depends on #1.
What is wrong
core/simulator/core.py:79:Two plant models, one
if. The choice is a boolean derived from whetherpp(PackParams) was passed (core.py:77-80), so "which plant" is encoded as "which optional argument is not None". A third model — a different chemistry, a reduced-order surrogate for fast sweeps, a degradation-aware plant for v9 — is another branch in the loop and another optional parameter onrun_simulation.The two classes already share an implicit contract the loop relies on:
step(...),get_measurement(),get_state(),reset()(core/physics/plant.py:520-706and:811-952). Nothing names it.What it should be
Same shape as the estimator seam (#2) and the strategy seam that already works:
PlantLikeProtocol owned by the harness (this is devkit code — a real battery is the plant).n_cellsand any pack-only trace shape (SimTraces(n_cells=…),core.py:80,92) become facts the plant reports about itself, not values the loop derives from a flag.Done when
Phase 1 of the platform epic. Depends on #1.