Transition Record
§4.8.3. The atom of recorded experience.
It lives here, with the element that PRODUCES it, rather than in ksl.modeling.decision.capture, which consumes it. ManagedPolicyIfc.onTransition takes one, and a policy interface cannot depend on the capture package without inverting the layering of E.1.
action is what was written to the levers, which is not always what the rule asked for. Under CLAMP_THEN_REJECT a request outside a lever's bounds is repaired before it is applied, and a lever whose feasible set is empty takes its declared neutral (§4.4.6.3). In both cases the rule's own vector is kept in proposedAction, and action carries the values that actually moved the model. The alternative — recording the request — makes the action column something that did not cause the reward column beside it, which is wrong in exactly the case a learner most needs right and gives no sign that it is wrong.
Not a data class, deliberately. A generated equals compares array properties by reference, so two records with identical contents are unequal and a Set keeps both, while the generated hashCode content-hashes the same arrays — the two halves disagree about what identity means. Comparison, deduplication and value assertions all need content equality, so both are written out below.
Constructors
Properties
What was WRITTEN to the levers, in declaration order.
Which element produced the row. A sink instance can serve several decision elements (§4.1.9) — captureTo { sink } over a captured variable is the ordinary idiom — and without this their rows interleave with nothing to tell them apart.
Per lever, in declaration order: was its feasible set empty at the decision, so that it took its declared neutral rather than anything the rule chose (§4.4.6.3)? Null when every lever had something to choose from. This is what distinguishes the rule chose to do nothing from the rule had nothing to choose.
What the policy returned, iff it differs from action. Null means it got what it asked for.
Where state was read: at the caller's call site, or in the element's own deferred event.
WHY it ended, not just that it did (§4.6.3).
The observation vector the policy was given, in declaration order.
The observation vector given at the next decision.
True iff the rule's request was repaired or overridden before it was applied.