Randomness and reproducibility¶
Keyed random streams¶
Every operator that draws random numbers has its own stream, keyed by its name and the lane's noise key:
Each operator draws a fixed number of values per step (per turn, for a slower operator), whatever its state. Two consequences:
- Adding an operator never changes another's noise. A plant with an extra disturbance or instrument keeps every other random sequence exactly as it was.
- Twin runs stay in sync. Lanes with the same noise key draw identical noise, so the difference between two lanes is caused only by what differs between them. See Twin runs and lanes.
Drawn values¶
Values drawn from distributions in a scenario, and values drawn by plan generators, come from streams keyed by their address in the config and the plant, for example units/TIC-101/K or plan/production/campaign/3. Adding or changing one distribution never changes another's draws, and every drawn value is recorded in the run's trace with its distribution and log-probability.
Reproducibility¶
The same scenario, seed, Homeostat version and NumPy version give identical output. run.meta["reproducibility"] records all four, together with the Python version, the platform, the step, the lanes and their noise keys, the recording interval, the initial state and a hash of the configuration. The hash covers the resolved template parameters and the library version, so two scenarios that describe the same plant differently get the same hash.