SampledSearch

class SampledSearch(candidates: Int = 200, uniform: GetValueIfc) : ActionSearch(source)

Score candidates actions drawn at random from the set.

This is the strategy for an action space that is neither small enough to enumerate nor low-dimensional enough to grid — which the declaration surface admits directly: several levers with state-dependent bounds produce sets of a million and more (§8.2.10).

uniform should be a RandomVariable the policy owns, per §4.5.6. Because sampling is by rejection, a tight constraint can starve it; a caller that must know should read ActionSet.acceptanceRate.

Constructors

Link copied to clipboard
constructor(candidates: Int = 200, uniform: GetValueIfc)

Functions

Link copied to clipboard
open override fun best(actions: ActionSet, score: (DoubleArray) -> Double): DoubleArray?

The action minimising score, or null when the set is empty. score is called at most once per candidate and must be pure.