kumulant

Bandit

interface Bandit(source)

Shared configuration and reset contract for bandits.

UnivariateBandit selects an arm without context; ContextualBandit selects one for a feature vector. Snapshotable adds snapshot, merge, and replica creation; PerArmBandit specialises it to one Result per arm.

Scorable and ContextualScorable expose independent per-arm scores for inspection or custom selection. Policies that sample a joint arm distribution, such as Top-Two Thompson and EXP3, do not expose independent scores.

Inheritors

Properties

nbrArms

abstract val nbrArms: Int(source)

Number of arms in the population. Fixed at construction; arm indices are [0, nbrArms).

random

abstract val random: Random(source)

Single source of randomness for UnivariateBandit.choose / ContextualBandit.choose and any policy-internal sampling. Callers pass a Random(seed) at construction for reproducible exploration; the bandit threads the same instance through every randomised decision.

Functions

reset

abstract fun reset()(source)

Clear all state back to the prior-seeded baseline. Equivalent to spawning a fresh bandit with the same configuration via Snapshotable.create, but in place; keeps the same arm count, policy, concurrency mode, and random instance.