EnvironmentNodeImpl

A node with non-negative concentration.

Constructors

Link copied to clipboard
constructor(environment: Environment<Double, out Any>)
Create a new environment node.

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

The node's molecules.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun addProperty(nodeProperty: NodeProperty<T>)
fun addProperty(nodeProperty: NodeProperty<T>)

Adds a capability to the node.

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

Adds a reaction to this node. The reaction is added only in the node, but not in the it.unibo.alchemist.core.Simulation scheduler, so it will never be executed. To add the reaction also in the scheduler (and start to execute it), you have to call also the method it.unibo.alchemist.core.Simulation.reactionAdded.

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

returns a NodeProperty of the provided superType.

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

Returns the node property of the reified type C.

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

returns a NodeProperty of the provided superType.

Link copied to clipboard
inline fun <T, C : NodeProperty<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(currentTime: Time): Node<T>
open fun cloneNode(currentTime: Time): 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.

Link copied to clipboard
fun compareTo(other: Node<T>): Int
abstract fun compareTo(p: T): Int
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
abstract fun equals(other: Any): Boolean
fun equals(other: Any): Boolean
Link copied to clipboard
fun forEach(action: Consumer<in Reaction<T>>)

Performs an action for every reaction.

open fun forEach(action: Consumer<in T>)
Link copied to clipboard
abstract fun getConcentration(molecule: Molecule): T
open fun getConcentration(molecule: Molecule): T

Calculates the concentration of a molecule.

Link copied to clipboard
abstract fun getContents(): Map<Molecule, T>
Link copied to clipboard
abstract fun getMoleculeCount(): Int
open fun getMoleculeCount(): Int
Link copied to clipboard
abstract fun getProperties(): List<NodeProperty<T>>
Link copied to clipboard
abstract fun getReactions(): List<Reaction<T>>

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
abstract fun iterator(): Iterator<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
abstract fun removeConcentration(moleculeToRemove: Molecule)
fun removeConcentration(moleculeToRemove: Molecule)
Link copied to clipboard
abstract fun removeReaction(reactionToRemove: Reaction<T>)
fun removeReaction(reactionToRemove: Reaction<T>)

Removes a reaction from this node. The reaction is removed only in the node, but not in the it.unibo.alchemist.core.Simulation scheduler, so the scheduler will continue to execute the reaction. To remove the reaction also in the scheduler (and stop to execute it), you have to call also the method it.unibo.alchemist.core.Simulation.reactionRemoved.

Link copied to clipboard
open fun setConcentration(@Nonnull molecule: Molecule, @Nonnull concentration: Double)
Sets the concentration of mol to c.
Link copied to clipboard
infix fun Node<*>.shouldEqual(other: Node<*>)
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
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