GenericNode

open class GenericNode<T> @JvmOverloads constructor(val incarnation: Incarnation<T, *>, val environment: Environment<T, *>, val id: Int = idFromEnv(environment), val reactions: MutableList<Reaction<T>> = ArrayList(), val molecules: MutableMap<Molecule, T> = LinkedHashMap(), val properties: MutableList<NodeProperty<T>> = ArrayList()) : Node<T>

This class realizes an abstract node. You may extend it to realize your own nodes.

Parameters

concentration type

Constructors

Link copied to clipboard
constructor(environment: Environment<T, *>)
constructor(incarnation: Incarnation<T, *>, environment: Environment<T, *>, id: Int = idFromEnv(environment), reactions: MutableList<Reaction<T>> = ArrayList(), molecules: MutableMap<Molecule, T> = LinkedHashMap(), properties: MutableList<NodeProperty<T>> = ArrayList())

Properties

Link copied to clipboard
open override val contents: Map<Molecule, T>
Link copied to clipboard

The environment in which the node is places.

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

simulation incarnation.

Link copied to clipboard
open override val moleculeCount: Int
Link copied to clipboard

The node's molecules.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
override fun addProperty(nodeProperty: NodeProperty<T>)
Link copied to clipboard
override fun addReaction(reactionToAdd: Reaction<T>)
Link copied to clipboard
open fun <C : NodeProperty<T>> asProperty(superType: Class<C>): C
open fun <C : NodeProperty<T>> asProperty(superType: KClass<C>): C
Link copied to clipboard
inline fun <T, C : NodeProperty<T>> Node<T>.asProperty(): C

returns a NodeProperty of the provided type C.

Link copied to clipboard
open fun <C : NodeProperty<T>> asPropertyOrNull(superType: Class<in C>): C?
open fun <C : NodeProperty<T>> asPropertyOrNull(superType: KClass<in C>): C?
Link copied to clipboard
inline fun <T, C : NodeProperty<T>> Node<T>.asPropertyOrNull(): C?

returns a NodeProperty of the provided type C or null if the node does not have a compatible property.

Link copied to clipboard
open override fun cloneNode(currentTime: Time): Node<T>
Link copied to clipboard
operator override fun compareTo(@Nonnull other: Node<T>): Int
Link copied to clipboard
open operator override fun contains(molecule: Molecule): Boolean
Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
override fun forEach(action: Consumer<in Reaction<T>>)

Performs an action for every reaction.

Link copied to clipboard
open override fun getConcentration(molecule: Molecule): T
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
operator override fun iterator(): Iterator<Reaction<T>>
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
override fun removeConcentration(moleculeToRemove: Molecule)
Link copied to clipboard
override fun removeReaction(reactionToRemove: Reaction<T>)
Link copied to clipboard
open override fun setConcentration(molecule: Molecule, concentration: T)
Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

Link copied to clipboard
override fun spliterator(): Spliterator<Reaction<T>>

Returns the reactions.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String