ConditionalEvent

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

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>>
Link copied to clipboard
open override val canExecute: Observable<Boolean>
Link copied to clipboard
open override var conditions: List<Condition<T>>
Link copied to clipboard
override val host: Node<T>
Link copied to clipboard
open override val meanDelay: Double
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun cloneOnNewNode(node: Node<T>): ConditionalEvent<T>
Link copied to clipboard
operator override fun compareTo(other: Reaction<T>): Int
Link copied to clipboard
open override fun dispose()
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
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)