A named observable sampled by the SimClock, auto-registered with Lab. More...
| Import Statement: | import Clayground.Lab |
Provide expr as a function returning a number; the SimClock samples all probes on a fixed sim-time grid, which keeps recorded series reproducible under seeded, stepped runs.
Example usage:
import Clayground.Lab Probe { name: "kineticEnergy"; unit: "J"; expr: () => world.totalEnergy() }
See also Lab, SimClock, Plot2D, and DataRecorder.
capacity : int |
Maximum retained samples (ring buffer).
expr : var |
Function returning the current numeric value.
name : string |
Unique name used by Lab, Plot2D and DataRecorder.
samples : var |
Retained samples as [{t, v}, ...].
unit : string |
Display unit, e.g. "J".
value : real |
Most recent sampled value.
void clear() |
Drops all samples.
var summary() |
Returns {first, last, min, max, mean, stddev, count} over the retained samples.
mean and stddev come from Welford's online algorithm rather than the sum-of-squares shortcut: over the full 1200-sample ring of a quantity with a large offset and small noise - a 9.81 baseline wobbling by millimetres - the naive form subtracts two nearly equal large numbers and can hand back a negative variance. This one cannot.
stddev is the population deviation: a probe's retained series is the whole run being described, not a sample drawn from a larger one.