Abstract2DEnvironment

Models a bidimensional environment.

Parameters

<T>

concentration type

<P>

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val nodes: ListSet<Node<T>>
Link copied to clipboard

Functions

Link copied to clipboard
open fun addGlobalReaction(reaction: GlobalReaction<T>)
Link copied to clipboard
abstract fun addLayer(p: Molecule, p1: Layer<T, P>)
open fun addLayer(molecule: Molecule, layer: Layer<T, P>)
Link copied to clipboard
abstract fun addNode(p: Node<T>, p1: P): Boolean
open fun addNode(node: Node<T>, position: P): Boolean
Link copied to clipboard

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

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

Link copied to clipboard

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

Link copied to clipboard
fun <T> Environment<T, *>.allShortestPaths(computeDistance: (Node<T>, Node<T>) -> Double = neighborDistanceMetric { n1, n2 -> getDistanceBetweenNodes(n1, n2) }): Map<Environments.UndirectedEdge<T>, Double>

Computes all the minimum distances with the provided metric using the Floyd–Warshall algorithm.

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 Set containing the SubNetworks.

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 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

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 fun forEach(action: Consumer<in Node<T>>)
open fun forEach(p: Consumer<in T>)
Link copied to clipboard
Link copied to clipboard
abstract fun getDistanceBetweenNodes(p: Node<T>, p1: Node<T>): Double
open fun getDistanceBetweenNodes(n1: Node<T>, n2: Node<T>): Double
Link copied to clipboard
abstract fun getGlobalReactions(): ListSet<GlobalReaction<T>>
open fun getGlobalReactions(): ListSet<GlobalReaction<T>>
Link copied to clipboard
abstract fun getIncarnation(): Incarnation<T, P>
Link copied to clipboard
abstract fun getLayer(p: Molecule): Layer<T, P>
open fun getLayer(molecule: Molecule): Layer<T, P>
Link copied to clipboard
abstract fun getLayers(): ListSet<Layer<T, P>>
open fun getLayers(): ListSet<Layer<T, P>>
Link copied to clipboard
abstract fun getLinkingRule(): LinkingRule<T, P>
Link copied to clipboard
abstract fun getNeighborhood(p: Node<T>): Neighborhood<T>
open fun getNeighborhood(node: Node<T>): Neighborhood<T>
Link copied to clipboard
abstract fun getNodeByID(p: Int): Node<T>
open fun getNodeByID(id: Int): Node<T>
Link copied to clipboard
abstract fun getNodeCount(): Int
Link copied to clipboard
abstract fun getNodes(): ListSet<Node<T>>
Link copied to clipboard
abstract fun getNodesWithinRange(p: Node<T>, p1: Double): ListSet<Node<T>>
open fun getNodesWithinRange(node: Node<T>, range: Double): ListSet<Node<T>>
Link copied to clipboard
Link copied to clipboard
abstract fun getPosition(p: Node<T>): P
open fun getPosition(node: Node<T>): P
Link copied to clipboard
Link copied to clipboard
abstract fun getSimulationOrNull(): Simulation<T, P>
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Returns true the network is segmented, false otherwise.

Link copied to clipboard
abstract fun isTerminated(): Boolean
open fun isTerminated(): Boolean
Link copied to clipboard
open fun iterator(): Iterator<Node<T>>
abstract fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun makePosition(p: Array<Number>): P
Link copied to clipboard
open fun moveNodeToPosition(@Nonnull node: Node<T>, @Nonnull newPosition: P)
Subclasses may override this method if they want to change the way a node moves towards some absolute position.
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
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

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

Link copied to clipboard
Link copied to clipboard
abstract fun removeNode(p: Node<T>)
open fun removeNode(node: Node<T>)
Link copied to clipboard
abstract fun setLinkingRule(p: LinkingRule<T, P>)
Link copied to clipboard
abstract fun setSimulation(p: Simulation<T, P>)
fun setSimulation(value: Simulation<T, P>)
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
open fun toString(): String

Not used internally. Override as you please.