SAPEREGradient

This class provides a fast and stable gradient implementation, inspired on the NBR construct used in Proto.

Parameters

<P>

Position type

Constructors

Link copied to clipboard
constructor(environment: Environment<List<ILsaMolecule>, P>, node: ILsaNode, sourceTemplate: ILsaMolecule, gradientTemplate: ILsaMolecule, valuePosition: Int, expression: String, contextTemplate: ILsaMolecule, gradThreshold: Double, timeDistribution: TimeDistribution<List<ILsaMolecule>>)
Builds a new SAPERE Gradient.
constructor(environment: Environment<List<ILsaMolecule>, P>, node: ILsaNode, timeDistribution: TimeDistribution<List<ILsaMolecule>>, sourceTemplate: String, gradientTemplate: String, valuePosition: Int, expression: String, contextTemplate: String, gradThreshold: Double)
Builds a new SAPERE Gradient.

Properties

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

Functions

Link copied to clipboard
Clones this reaction's program on a new node, for example when nodes are created at runtime.
Link copied to clipboard
fun compareTo(other: Reaction<T>): Int
abstract fun compareTo(p: T): Int
Link copied to clipboard
abstract fun dispose()

Disposes and releases the resources held by this object.

open fun dispose()
Disposes and releases the resources held by this object.
Link copied to clipboard
abstract fun execute()

Executes this reaction.

open fun execute()

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

Link copied to clipboard
abstract fun getActions(): List<Action<T>>

The Actions executed by this reaction.

The Actions executed by this reaction.
Link copied to clipboard

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.

Observes whether the reaction procedure can be selected and executed by the engine.
Link copied to clipboard
abstract fun getConditions(): List<Condition<T>>

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

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
abstract fun getHost(): Node<T>

The Node hosting this reaction.

abstract fun getHost(): ReactionHost<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 fun getLsaNode(): ILsaNode
Returns the node hosting this reaction.
Link copied to clipboard
abstract fun getMeanDelay(): Double

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

open fun getMeanDelay(): Double
The expected delay between two occurrences of this reaction in the current model state.
Link copied to clipboard

The delay distribution governing this reaction's putative occurrences.

Link copied to clipboard
abstract fun initializationComplete(atTime: Time, environment: Environment<T, out Any>)

Activates reactive inputs after the environment is fully initialized and establishes the first occurrence.

fun initializationComplete(atTime: Time, environment: Environment<T, out Any>)

Initializes reactive inputs after the model has been fully assembled.

Link copied to clipboard
abstract fun setActions(<set-?>: List<out Action<T>>)
open fun setActions(value: List<out Action<T>>)

The Actions executed by this reaction.

Link copied to clipboard
abstract fun setConditions(<set-?>: List<out Condition<T>>)
open fun setConditions(value: List<out Condition<T>>)

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

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

Advances distribution-backed scheduling after successful execution at currentTime.

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

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

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