DecisionElement

§4.10.1 and §4.10.2. Declared through decisionElement; never constructed directly.

Properties

Link copied to clipboard
lateinit var catalog: DecisionCatalog
Link copied to clipboard

How many sinks are attached.

Link copied to clipboard

The priority this element's epoch events carry (§4.6.2, G.9 row 12). Lower sorts earlier.

Link copied to clipboard

How many deferred requests have been made this replication, duplicates included.

Link copied to clipboard

How many transitions this element discarded because they had no duration (S§C.11.2).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

How many decision requests arrived after the episode had already ended (see decide).

Link copied to clipboard

Whether anything is listening (§4.8.2).

Link copied to clipboard

The reason given to the most recent decision this element took.

Link copied to clipboard
Link copied to clipboard
@set:KSLControl(controlType = ControlType.INTEGER, lowerBound = 1.0)
var maxEpochs: Int

A cap on decisions per episode.

Link copied to clipboard

The reasons requested and not yet decided on, in request order.

Link copied to clipboard

The rule. Replication-initial: the setter throws while the model is running. Assigning a ShapeAwarePolicyIfc calls its configure(descriptor()) immediately, so a rule that requires something of the shape, or must build something from it, fails or does its work here rather than at the first epoch.

Link copied to clipboard

Labels this rule in trajectories and reports. Defaults to the policy's class name.

Functions

Link copied to clipboard
protected open override fun afterExperiment()

This method should be overridden by subclasses that need actions performed after an experiment has been completed It is called after all replications are done and can be used to collect data from the model element, etc.

Link copied to clipboard

Send this element's transitions to sink, from now until it is detached (§4.8.2).

Link copied to clipboard
protected open override fun beforeExperiment()

This method should be overridden by subclasses that need logic to be performed prior to an experiment. The beforeExperiment method allows model elements to be set up prior to the first replication within an experiment. It is called once before any replications occur.

Link copied to clipboard
Link copied to clipboard
fun decide(reason: String)

Take a decision now, on behalf of reason.

Link copied to clipboard
Link copied to clipboard

Detach every sink. Closes none of them, for the reason detachTransitionSink gives.

Link copied to clipboard

Stop sending transitions to sink. Returns whether it was attached.

Link copied to clipboard
protected open override fun initialize()

This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called

Link copied to clipboard

Whether sink is currently attached to this element.

Link copied to clipboard

Resolve the lever declared over owner. The owner is a lookup KEY here, not the lever's identity (§4.1.2.2): it must resolve to exactly one lever, and throws AmbiguousLeverException if it backs several.

Link copied to clipboard
fun leverRef(declaredName: String): LeverRef

Resolve a declared lever by name.

Link copied to clipboard
Link copied to clipboard
fun narrow(lever: LeverRef, limits: IntRange)
Link copied to clipboard
protected open override fun replicationEnded()

This method should be overridden by subclasses that need actions performed when the replication ends and prior to the calling of afterReplication(). It is called when each replication ends and can be used to collect data from the model element, etc.

Link copied to clipboard
fun requestDecision(reason: String)

Ask for a decision at the current time, taken in an event of the element's own.

Link copied to clipboard

Resolve the reward term declared over source. Symmetric with leverFor, including its failure modes: a source backing several terms is ambiguous, and D.16 records that fixing one half of the lever/reward pair alone is how the same defect keeps recurring.

Link copied to clipboard
fun rewardRate(term: RewardRef, rate: Double)

A rate is a parameter (§4.1.3), so it is replication-initial and re-signed on assignment — the sense was fixed at declaration and only the magnitude is being set here.

Link copied to clipboard
fun rewardRef(declaredName: String): RewardRef
Link copied to clipboard

What the declaration says about units, and what it therefore could not check (§4.2.4).

Link copied to clipboard
protected open override fun warmUp()

This method should be overridden by subclasses that need actions performed at the warm-up event during each replication. It is called once during each replication if the model element reacts to warm-up actions.