Node

Parameters

The type of the concentration

This interface must be implemented in every realization of node

Inheritors

Types

Link copied to clipboard
object Companion

Utilities for Nodes.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val id: Int
Link copied to clipboard

Observes the count of different molecules in this node.

Link copied to clipboard
abstract val properties: List<Capability<T>>
Link copied to clipboard
abstract override val reactions: ObservableList<Reaction<T>>

This method allows to access all the reaction of the node.

Functions

Link copied to clipboard
abstract fun addProperty(capability: Capability<T>)

Adds a capability to the node. Properties are part of the node setup: adding one fails once the node is in an environment, so properties can be read without being observed.

Link copied to clipboard
abstract fun addReaction(reaction: Reaction<T>)

Registers reaction and notifies the running simulation when it was not already present. Fails if this is not the Reaction.host of reaction.

Link copied to clipboard
open fun <C : Capability<T>> asProperty(superType: Class<C>): C
open fun <C : Capability<T>> asProperty(superType: KClass<C>): C

returns a Capability of the provided superType.

Link copied to clipboard
inline fun <T, C : Capability<T>> Node<T>.asProperty(): C

Returns the node property of the reified type C.

Link copied to clipboard
open fun <C : Capability<T>> asPropertyOrNull(superType: Class<in C>): C?
open fun <C : Capability<T>> asPropertyOrNull(superType: KClass<in C>): C?

returns a Capability of the provided superType.

Link copied to clipboard
inline fun <T, C : Capability<T>> Node<T>.asPropertyOrNull(): C?

Returns the node property of the reified type C, or null if the node does not have a compatible property.

Link copied to clipboard
abstract fun cloneNode(): Node<T>

Creates a new Node which is a clone of the current Node. The new Node will have all the current Node's properties, such as reactions and molecules, but it will also have a different ID. Its reactions are cloned through NodeReaction.cloneOnNewNode.

Link copied to clipboard
abstract operator fun compareTo(other: Node<T>): Int
Link copied to clipboard
abstract fun concentrationOf(molecule: Molecule): Observable<Option<T>>

Observe the concentration calculated with the given molecule. The result of this computation is wrapped into an Option and some if the value is present, otherwise none.

Link copied to clipboard
abstract operator fun contains(molecule: Molecule): Boolean

Tests whether a node contains a Molecule.

Link copied to clipboard
abstract fun containsMolecule(molecule: Molecule): Observable<Boolean>

Observes whether a node contains a Molecule.

Link copied to clipboard
abstract fun dispose()

Disposes and releases the resources held by this object.

Link copied to clipboard
abstract operator override fun equals(other: Any?): Boolean
Link copied to clipboard
abstract operator fun get(molecule: Molecule): Option<T>

The concentration of a molecule, some if the molecule is present in this node, none otherwise.

Link copied to clipboard
abstract override fun hashCode(): Int
Link copied to clipboard
open fun Reaction<T>.remove()

Unregisters this reaction from its host, see removeReaction.

Link copied to clipboard
abstract fun removeAllConcentrationOf(moleculeToRemove: Molecule)
Link copied to clipboard
abstract fun removeReaction(reaction: Reaction<T>)

Unregisters reaction and notifies the running simulation when it was actually present.

Link copied to clipboard
abstract operator fun set(molecule: Molecule, concentration: T)

Sets the concentration of mol to c.

Link copied to clipboard
infix fun Node<*>.shouldEqual(other: Node<*>)
Link copied to clipboard
Link copied to clipboard
fun <T, P : Position<out P>, TS : Any, PS : PositionSurrogate> Node<T>.toNodeSurrogate(environment: Environment<T, P>, toConcentrationSurrogate: (T) -> TS, toPositionSurrogate: (P) -> PS): NodeSurrogate<TS, PS>