Abstract2DEnvironment

Models a bidimensional environment.

Parameters

incarnation

the incarnation to be used.

Type Parameters

T

concentration type

Properties

Link copied to clipboard
open val Node<T>.currentPosition: P
Link copied to clipboard
override val dimensions: Int = 2
Link copied to clipboard
override val incarnation: Incarnation<T, P>
Link copied to clipboard
open override val isTerminated: Boolean
Link copied to clipboard
override val layers: Map<Molecule, Layer<T, P>>
Link copied to clipboard
Link copied to clipboard
override var networkModel: NetworkModel<T>
Link copied to clipboard
override val nodeCount: Observable<Int>
Link copied to clipboard
open override val nodes: ObservableList<Node<T>>
Link copied to clipboard
override val offset: DoubleArray
Link copied to clipboard
open val Node<T>.position: Observable<P>
Link copied to clipboard
open override val reactions: ObservableList<Reaction<T>>
Link copied to clipboard
override var simulation: Simulation<T, P>
Link copied to clipboard
override var simulationOrNull: Simulation<T, P>?
Link copied to clipboard
override val size: DoubleArray
Link copied to clipboard
open override val sizeInDistanceUnits: DoubleArray

Override this property if units measuring distance do not match with units used for coordinates. For instance, if your space is non-Euclidean, or if you are using polar coordinates. A notable example is using geographical latitude-longitude as y-x coordinates and meters as distance measure.

Functions

Link copied to clipboard
open override fun addLayer(molecule: Molecule, layer: Layer<T, P>)
Link copied to clipboard
open override fun addNode(node: Node<T>, position: P): Boolean
Link copied to clipboard
open override fun addReaction(reaction: Reaction<T>)
Link copied to clipboard
open fun addTerminator(terminator: (Environment<T, P>) -> Boolean)

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

Adds to the simulation a predicate that determines whether a simulation should be terminated.

Link copied to clipboard
fun <T> Environment<T, *>.allShortestHopPaths(): SymmetricMatrix<Double>

Calculates the shortest paths using the Floyd-Warshall algorithm calculating the Hop Distance between nodes.

Link copied to clipboard
fun <T> Environment<T, *>.allSubNetworks(computeDistance: (Node<T>, Node<T>) -> Double = environmentMetricDistance()): Set<Network<T>>

Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes. Returns a Map containing the subnetwork related to each Node of the environment.

Link copied to clipboard
fun <T> Environment<T, *>.allSubNetworksByNode(computeDistance: (Node<T>, Node<T>) -> Double = environmentMetricDistance()): Map<Node<T>, Network<T>>

Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes. Returns a Map mapping each node to the subnetwork it belongs to.

Link copied to clipboard

Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes, evaluated using the allShortestHopPaths method. Returns a Set containing the subnetworks.

Link copied to clipboard

Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes, evaluated using the allShortestHopPaths method. Returns a Set containing the subnetworks.

Link copied to clipboard
open operator override fun contains(node: Node<T>): Boolean
Link copied to clipboard
open override fun currentPositionOf(node: Node<T>): P
Link copied to clipboard
open override fun distanceBetween(n1: Node<T>, n2: Node<T>): Double
Link copied to clipboard
open fun Node<T>.distanceTo(other: Node<T>): Double
Link copied to clipboard
open override fun farthestReachablePosition(node: Node<T>, desired: P): P

Movements are unconstrained: subclasses constraining them override this function, starting from the position that it returns.

Link copied to clipboard

Returns true the network is segmented, false otherwise.

Link copied to clipboard
open override fun layerFor(molecule: Molecule): Layer<T, P>?
Link copied to clipboard
abstract fun makePosition(coordinates: DoubleArray): P
open fun makePosition(coordinates: List<Number>): P
abstract fun makePosition(vararg coordinates: Number): P
Link copied to clipboard
open override fun moveNodeTo(node: Node<T>, position: P)

Moves node to the farthestReachablePosition towards position, extending the environment to include it.

Link copied to clipboard
open fun Node<T>.moveTo(position: P)
Link copied to clipboard
open override fun neighborhoodOf(node: Node<T>): Observable<Neighborhood<T>>
Link copied to clipboard

Returns the diameter of the network in environment units if it is not segmented, and NaN otherwise.

Link copied to clipboard

Returns the hop-distance diameter of the network if it is not segmented, and NaN otherwise.

Computes the network diameter of the segment containing node.

Link copied to clipboard
open override fun nodesAround(position: P, range: Double): List<Node<T>>
open override fun nodesAround(node: Node<T>, range: Double): List<Node<T>>
Link copied to clipboard
open fun P.nodesInRange(range: Double): List<Node<T>>
open fun Node<T>.nodesInRange(range: Double): List<Node<T>>
Link copied to clipboard
open override fun nodeWithId(id: Int): Node<T>
Link copied to clipboard
open override fun observeLayerValue(molecule: Molecule, node: Node<T>): Observable<T?>
Link copied to clipboard
open override fun observeNodesAround(position: P, range: Double): ObservableSet<Node<T>>
open override fun observeNodesAround(node: Node<T>, range: Double): ObservableSet<Node<T>>
Link copied to clipboard
Link copied to clipboard
open override fun positionOf(node: Node<T>): Observable<P>
Link copied to clipboard
open fun Node<T>.remove()
open fun Reaction<T>.remove()
Link copied to clipboard
open override fun removeNode(node: Node<T>)
Link copied to clipboard
open override fun removeReaction(reaction: Reaction<T>)
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Not used internally. Override as you please.