NeighborHasConcentration

class NeighborHasConcentration<T>(reaction: NodeReaction<T>, val environment: Environment<T, *>, val target: Molecule, val concentration: T) : AbstractLocalCondition<T>

A condition that evaluates whether at least one neighbor of a node has the specified concentration of a given molecule.

Parameters

reaction

the reaction owning this condition, whose node is evaluated.

environment

the environment containing the node and its neighborhood.

target

the molecule to check in the neighborhood

concentration

the target concentration of the molecule to be checked in the neighborhood

Type Parameters

T

the type of concentration

Constructors

Link copied to clipboard
constructor(reaction: NodeReaction<T>, environment: Environment<T, *>, target: Molecule, concentration: T)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override val isValid: Observable<Boolean>

The live validity of this condition.

Link copied to clipboard
override val reaction: NodeReaction<T>

The NodeReaction owning this condition, hosted by targetNode.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Signals that the owning reaction is about to fire. Used to implement conditions latched to changes that occur in-between reaction executions.

Link copied to clipboard
override fun cloneCondition(newReaction: Reaction<T>): Condition<T>

Creates an equivalent condition owned by newReaction, such as a reaction cloned onto a new node. A condition targeting the host of its reaction targets the host of newReaction, which must then be a Node; a condition targeting any other node keeps its target.

Link copied to clipboard
open override fun dispose()

Disposes and releases the resources held by this object.

Link copied to clipboard
infix fun Condition<*>.shouldEqual(other: Condition<*>)
Link copied to clipboard
open override fun toString(): String