Snapshotable
State surface for any bandit whose state can be checkpointed, replicated, and merged with a sibling's. Orthogonal to the action surface; every bandit family has its own natural S:
Per-arm-stat bandits (com.eignex.kumulant.bandit.univariate.MultiArmedBandit and friends) use
List<R>whereRis the per-arm result type; see the PerArmBandit convenience.Joint-state bandits (com.eignex.kumulant.bandit.univariate.Exp3Bandit, com.eignex.kumulant.bandit.contextual.Exp4Bandit) use a single state object that captures the expert weights.
The pattern: workers run the same bandit configuration in parallel, periodically call snapshot, ship snapshots to a coordinator, the coordinator runs its own bandit and folds each worker's snapshot in via merge. Because the merge unit is the snapshot (not a live bandit), the worker is free to terminate after each report.
Inheritors
Functions
Spawn a fresh bandit with the same configuration; state resets to the prior seed. The random source is replaced; pass the source you want the new bandit to use for exploration (which is independent of merging in another snapshot's state).
Materialise the current state as a serialisable snapshot. Reads are non-mutating; call as often as needed without affecting decisions. Same snapshot consistency rules as com.eignex.kumulant.core.Stat.read ; under com.eignex.kumulant.core.Concurrency.Relaxed coupled cells may drift by ULPs.
create
Spawn a fresh bandit with the same configuration; state resets to the prior seed. The random source is replaced; pass the source you want the new bandit to use for exploration (which is independent of merging in another snapshot's state).
Useful when a worker accepts a stream of snapshots to apply sequentially: create(random).also { it.merge(snapshot) }.
merge
snapshot
Materialise the current state as a serialisable snapshot. Reads are non-mutating; call as often as needed without affecting decisions. Same snapshot consistency rules as com.eignex.kumulant.core.Stat.read ; under com.eignex.kumulant.core.Concurrency.Relaxed coupled cells may drift by ULPs.