ConditionalEvent

class ConditionalEvent<T>(node: Node<T>, timeDistribution: TimeDistribution<T>) : GenericReaction<T>

A single-use event scheduled by condition validity and a timeDistribution.

No sample is drawn while the conditions are invalid. Becoming valid draws one delay from timeDistribution. If the conditions become invalid before execution, that putative occurrence is discarded and the event publishes Time.INFINITY. The next invalid-to-valid transition draws a new delay. Repeated updates while validity remains true do not redraw the occurrence. After successful action execution, the event unregisters itself from node.

Parameters

node

node hosting the event

timeDistribution

generator for delays from each enabling transition

Type Parameters

T

concentration type

Constructors

Link copied to clipboard
constructor(node: Node<T>, timeDistribution: TimeDistribution<T>)

Properties

Link copied to clipboard
open override var actions: List<Action<T>>

The Actions executed by this reaction.

Link copied to clipboard
open override val canExecute: Observable<Boolean>

Observes whether the reaction procedure can be selected and executed by the engine. This observable emits updates when that state changes. Reactions whose procedure includes checking occurrence-time conditions may remain executable even when those conditions will suppress their model effects.

Link copied to clipboard
open override var conditions: List<Condition<T>>

The Conditions interpreted by this reaction's scheduling and execution policy.

Link copied to clipboard

The current meanDelay, for consumers requiring it to be finite and positive, such as those converting speeds into per-occurrence movements.

Link copied to clipboard
override val host: Node<T>

The model entity hosting this reaction, fixed for the lifetime of the reaction. A host only registers reactions whose host is the host itself.

Link copied to clipboard
open override val meanDelay: Double

The expected delay between two occurrences of this reaction in the current model state.

Link copied to clipboard

The absolute Time of the next occurrence.

Link copied to clipboard

The delay distribution governing this reaction's putative occurrences.

Functions

Link copied to clipboard
open override fun cloneOnNewNode(node: Node<T>): ConditionalEvent<T>

Clones this reaction's program on a new node, for example when nodes are created at runtime.

Link copied to clipboard
operator override fun compareTo(other: Reaction<T>): Int
Link copied to clipboard
open override fun dispose()

Disposes and releases the resources held by this object.

Link copied to clipboard
open override fun execute()

Prepares valid conditions, applies the model mutation, and advances surviving distributed reactions.

Link copied to clipboard
override fun initializationComplete(atTime: Time, environment: Environment<T, *>)

Initializes reactive inputs after the model has been fully assembled.

Link copied to clipboard
infix fun Reaction<*>.shouldEqual(other: Reaction<*>)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
override fun updateSchedulingAfterFiring(currentTime: Time)

Refreshes reaction state after firing, then applies firing scheduling policy.

Link copied to clipboard
override fun updateSchedulingAfterInvalidation(currentTime: Time)

Refreshes this reaction's scheduling after one or more observed model inputs changed.