ActionSet

interface ActionSet(source)

The feasible action set 𝒳(s) as an OBJECT rather than as scattered members of the decision context (§4.4.6.5).

An earlier form of §4.4.6 put feasibleBounds, isFeasible and violations directly on DecisionContext and left feasibleActions unbuilt. That correctly identified that the set was missing and then failed to name it, so every rule that wanted to search 𝒳(s) rebuilt the loop, the filter and the argmin for itself. Naming it makes those reusable and testable without a simulation.

All members are pure and epoch-scoped: an instance is valid only during the action call that received the context carrying it.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val acceptanceRate: Double

Accepted draws over attempted draws, since this set was created. NaN before any.

Link copied to clipboard
abstract val leverCount: Int

How many levers an action vector has.

Link copied to clipboard
abstract val size: Long?

How many actions the set contains, or null when that is not a useful question — any CONTINUOUS lever, or a discrete product beyond ENUMERATION_CEILING.

Functions

Link copied to clipboard

Every action in the set. Throws when size is null, because a rule that reaches here without checking has made an error the library should not paper over.

Link copied to clipboard
abstract fun bounds(leverIndex: Int): ClosedFloatingPointRange<Double>

Bounds in force for this lever at this epoch: envelope ∩ narrowed ∩ 𝒳(s) (§4.3.3).

Link copied to clipboard
abstract operator fun contains(action: DoubleArray): Boolean

Membership. The same predicate the element applies when the action arrives.

Link copied to clipboard
abstract fun sample(uniform: GetValueIfc, count: Int, maxAttempts: Int = count * 20): Sequence<DoubleArray>

Up to count feasible actions drawn at random — the only way to search a set that asSequence cannot walk, which on a model with several state-dependent levers is the usual case rather than the exception (§8.2.10: 97% of epochs).

Link copied to clipboard
abstract fun violations(action: DoubleArray): List<String>

Why not. Empty exactly when contains is true.