DecisionContext

Everything a rule may know at a decision instant.

The element reuses one instance and updates the epoch-scoped members in place, so a retained context would answer questions about a later epoch than the one the rule thinks it is in. That used to be documented as "retaining it is a bug" and nothing prevented it; it is now enforced — every epoch-scoped member throws StaleDecisionContextException when read outside the action call that supplied it (§4.5.3, G.9 row 6).

The declared-shape members are exempt, and the split is the point: they are constant for the life of the element, so retaining them is harmless and a rule that wants to keep the lever names may. What a rule may not keep is anything that means something different at the next epoch.

Properties

Link copied to clipboard
abstract val actions: ActionSet

What may be done NOW: the feasible set 𝒳(s) as an object (§4.4.6.5).

Link copied to clipboard
Link copied to clipboard

The current value of each lever, or NaN in any position whose lever is a ksl.modeling.decision.descriptor.LeverKind.TRANSACTION — a transaction has no current value, and NaN says so rather than inventing one. A rule that wants "do nothing" wants neutralAction, which is defined for both kinds.

Link copied to clipboard
abstract val elementName: String
Link copied to clipboard
abstract val epochIndex: Int
Link copied to clipboard
Link copied to clipboard

Indexed, not mapped: read at every epoch (§4.2.3).

Link copied to clipboard
abstract val leverNames: List<String>
Link copied to clipboard
abstract val leverUnits: List<String?>
Link copied to clipboard
abstract val modelName: String
Link copied to clipboard

Do nothing, as each lever declared it (§8.2.3): the current value of a setting, the declared amount of a transaction.

Link copied to clipboard
Link copied to clipboard
abstract val observationUnits: List<String?>

What each observation and each lever is measured in, positionally, null where none was declared (§4.2.4).

Link copied to clipboard
open val reason: String

Why this decision is being taken — the label its caller gave to decide or requestDecision (S§C.11.3, D6).

Link copied to clipboard
Link copied to clipboard
abstract val replicationId: Int
Link copied to clipboard
abstract val simulationTime: Double

Functions

Link copied to clipboard
abstract fun budgetTotal(leverIndex: Int): Double?

Total of the budget governing the lever at leverIndex, or null if it is in none.