LsaNode

This class realizes a node with LSA concentration.

Constructors

Link copied to clipboard
constructor(environment: Environment<List<ILsaMolecule>, out Any>)
Builds a new LsaNode.

Properties

Link copied to clipboard
Link copied to clipboard

The environment in which the node is places.

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

Functions

Link copied to clipboard
open fun addLsa(instance: ILsaMolecule)
Adds an instance of ILsaMolecule in the node's LsaSpace.
Link copied to clipboard
abstract fun addProperty(capability: Capability<T>)
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>)
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: 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

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>
open 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
fun compareTo(other: Node<T>): Int
abstract fun compareTo(p: T): Int
Link copied to clipboard
@NotNull
open fun concentrationOf(@NotNull molecule: Molecule): Observable<Option<List<ILsaMolecule>>>
Observe the concentration calculated with the given molecule.
Link copied to clipboard
abstract fun contains(molecule: Molecule): Boolean
open fun contains(molecule: Molecule): Boolean

Tests whether a node contains a Molecule.

Link copied to clipboard
@NotNull
open fun containsMolecule(@NotNull molecule: Molecule): Observable<Boolean>
Observes whether a node contains a Molecule.
Link copied to clipboard
open fun dispose()
abstract fun dispose()

Disposes and releases the resources held by this object.

Link copied to clipboard
abstract fun equals(other: Any): Boolean
fun equals(other: Any): Boolean
Link copied to clipboard
abstract fun get(molecule: Molecule): Option<T>
open 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
Link copied to clipboard
Link copied to clipboard
Returns the LSA molecules in this node.
Link copied to clipboard
@NotNull
open fun getMoleculeCount(): Observable<Integer>
Observes the count of different molecules in this node.
Link copied to clipboard
abstract fun getProperties(): List<Capability<T>>
Link copied to clipboard

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

Link copied to clipboard
abstract fun hashCode(): Int
fun hashCode(): Int
Link copied to clipboard
open fun matching(template: ILsaMolecule): List<ILsaMolecule>
Finds the LSA instances in this node that [template] matches.
Link copied to clipboard
@NotNull
open fun observeCandidates(@NotNull template: ILsaMolecule): Observable<List<ILsaMolecule>>
Observes the instances that [template] may match: those sharing its first argument when it is a constant or a number, every instance otherwise.
Link copied to clipboard
Observes the LSA space of this node.
Link copied to clipboard
open fun remove($this$remove: Reaction<T>)

Unregisters this reaction from its host, see removeReaction.

Link copied to clipboard
open fun removeAllConcentrationOf(@Nonnull moleculeToRemove: Molecule)
Removes every copy of [moleculeToRemove] from this node.
Link copied to clipboard
open fun removeOneMatchedLsa(matchedInstance: ILsaMolecule): Boolean
Deletes an ILsaMolecule from the Node LsaSpace Warning: the method removes only the first matched ILsaMolecule.
Link copied to clipboard
abstract fun removeReaction(reaction: Reaction<T>)
fun removeReaction(reaction: Reaction<T>)

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

Link copied to clipboard
open fun set(@Nonnull molecule: Molecule, c: List<ILsaMolecule>)
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>
Link copied to clipboard
open fun toString(): String