Constructors

Link copied to clipboard
constructor(incarnation: Incarnation<T, Euclidean2DPosition>)

Properties

Link copied to clipboard
override val dimensions: Int
Link copied to clipboard
open override val globalReactions: ListSet
Link copied to clipboard
Link copied to clipboard
override val isTerminated: Boolean
Link copied to clipboard
override val layers: ListSet
Link copied to clipboard
Link copied to clipboard
override val nodeCount: Int
Link copied to clipboard
override val nodes: ListSet
Link copied to clipboard
override val offset: DoubleArray
Link copied to clipboard
open override val origin: Euclidean2DPosition

Create a position corresponding to the origin of this environment.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override val size: DoubleArray
Link copied to clipboard
open override val sizeInDistanceUnits: DoubleArray

Functions

Link copied to clipboard
open override fun addGlobalReaction(reaction: GlobalReaction<T>)
Link copied to clipboard
override fun addLayer(molecule: Molecule, layer: Layer<T, Euclidean2DPosition>)

Add a Layer to the Environment.

Link copied to clipboard
override fun addNode(node: Node<T>, position: Euclidean2DPosition): Boolean

This method allows to add a new node to this environment in a specific position. The environment is responsible to call the right method of the simulation in order to ensure that the reaction is properly scheduled. The function returns true if the node is added to the environment.

Link copied to clipboard

Add a terminator indicating whether the simulation should be considered finished.

open override fun addTerminator(terminator: TerminationPredicate<T, Euclidean2DPosition>)

Add a terminator indicating whether the simulation should be considered finished.

Link copied to clipboard
override fun forEach(action: Consumer<in Node<T>>)
Link copied to clipboard
override fun getDistanceBetweenNodes(n1: Node<T>, n2: Node<T>): Double

Measures the distance between two nodes (n1, n2) in the environment.

Link copied to clipboard
override fun getLayer(molecule: Molecule): Layer<T, Euclidean2DPosition>?

Get the Layer associate to the given molecule. If no Layer is associated with the given molecule, return null.

Link copied to clipboard
override fun getNeighborhood(node: Node<T>): Neighborhood<T>

Given a node, this method returns its neighborhood.

Link copied to clipboard
override fun getNodeByID(id: Int): Node<T>

Allows to access a Node in this Environment known its id. Depending on the implementation, this method may or not be optimized (namely, id could run in constant or linear time with the number of nodes).

Link copied to clipboard
override fun getNodesWithinRange(node: Node<T>, range: Double): ListSet

Given a node this method returns a list of all the surroundings nodes within the given range. Note that this method (depending on the implementation) might be not optimized, and it's consequently much better to use Environment.getNeighborhood and filter the neighborhood if you are sure that all the nodes within the range are connected to the center.

override fun getNodesWithinRange(position: Euclidean2DPosition, range: Double): ListSet

Given a position this method returns a list of all the surroundings nodes within the given range. Note that this method (depending on the implementation) might be not optimized.

Link copied to clipboard
override fun getPosition(node: Node<T>): Euclidean2DPosition

Calculates the position of a node.

Link copied to clipboard
operator override fun iterator(): Iterator<Node<T>>
Link copied to clipboard
abstract fun makePosition(vararg coordinates: Number): Euclidean2DPosition
open fun makePosition(coordinates: List<Number>): Euclidean2DPosition

Given the coordinates of the point, returns a Position compatible with this environment.

Creates a new Euclidean2DPosition.

Link copied to clipboard
open fun moveNode(node: Node<T>, direction: Euclidean2DPosition)

This method moves a node in the environment toward some direction. If node move is unsupported, it does nothing. Subclasses may override this method if they want to change the way a node moves towards some direction. The current implementation internally calls {@link #moveNodeToPosition(Node, Position2D)}, as such, overriding that method may suffice.

Link copied to clipboard
open override fun moveNodeToPosition(node: Node<T>, position: Euclidean2DPosition)

This method moves a node in the environment to some position. If node move is unsupported, it does nothing.

Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: <Error class: unknown class>): R

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

Link copied to clipboard
open override fun removeGlobalReaction(reaction: GlobalReaction<T>)

Remove a GlobalReaction from the Environment.

Link copied to clipboard
override fun removeNode(node: Node<T>)

This method allows to remove a node. If node removal is unsupported, it does nothing.

Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: <Error class: unknown class>): Iterable<R>

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

Link copied to clipboard
override fun spliterator(): Spliterator<Node<T>>
Link copied to clipboard
fun <T, P : Position<out P>, TS : Any> Environment<T, P>.toEnvironmentSurrogate(toConcentrationSurrogate: (T) -> TS): EnvironmentSurrogate<TS, PositionSurrogate>

A function that maps an Environment to its surrogate class (EnvironmentSurrogate). Use the toSuitablePositionSurrogate strategy for PositionSurrogate mapping.

fun <T, P : Position<out P>, TS : Any, PS : PositionSurrogate> Environment<T, P>.toEnvironmentSurrogate(toConcentrationSurrogate: (T) -> TS, toPositionSurrogate: (P) -> PS): EnvironmentSurrogate<TS, PS>

A function that maps an Environment to its surrogate class (EnvironmentSurrogate).

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

Not used internally. Override as you please.