kumulant

PerArmBandit

Bandit state represented as one Result per arm, in arm-index order. armResult allows inspection of one arm without requiring a full snapshot.

Inheritors

Functions

armResult

open fun armResult(armIndex: Int): R(source)

Per-arm snapshot at armIndex. Default implementation reads from the full snapshot; implementations may override to avoid building the entire list when only one arm is needed.

Link copied to clipboard
abstract fun create(random: Random): Snapshotable<List<R>>

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).

Link copied to clipboard
abstract fun merge(other: List<R>)

Fold another replica's other state into this bandit. Most families merge exactly via the underlying stat's parallel-merge formula; SGD- based contextual bandits merge approximately. Each concrete bandit's KDoc documents its merge semantics.

Link copied to clipboard
abstract fun snapshot(): List<R>

Return the current state without adding observations or choosing an arm. Consistency follows the implementation's concurrency contract; a snapshot of independently updated cells need not represent a single instant.