GenericReaction

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

A generic reaction gated by condition validity that schedules a new sample after every occurrence.

Parameters

node

node hosting the reaction

timeDistribution

delay generator

Type Parameters

T

concentration type

Inheritors

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>): GenericReaction<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.