← Back to Docs
  • index.html
  • Clayground
  • Clayground.Lab
  • Probe
  • Clayground 2026.7
  • Probe QML Type

    A named observable sampled by the SimClock, auto-registered with Lab. More...

    Import Statement: import Clayground.Lab

    Properties

    Methods

    Detailed Description

    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.

    Property Documentation

    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 [read-only]

    Retained samples as [{t, v}, ...].


    unit : string

    Display unit, e.g. "J".


    value : real [read-only]

    Most recent sampled value.


    Method Documentation

    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.