AbstractEnvironment

abstract class AbstractEnvironment<T, P : Position<P>?> : Environment<T, P> (source)

Very generic and basic implementation for an environment. Basically, only manages an internal set of nodes and their position.

Parameters

<T>

concentration type

<P>

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@get:Nonnull
val nodes: ListSet<Node<T>>
Link copied to clipboard
@Nullable
@get:Nonnull
open var simulation: Simulation<T, P>

Functions

Link copied to clipboard
open fun addGlobalReaction(@Nonnull reaction: GlobalReaction<T>)
Link copied to clipboard
fun addLayer(@Nonnull molecule: Molecule, @Nonnull layer: Layer<T, P>)
Link copied to clipboard
fun addNode(@Nonnull node: Node<T>, @Nonnull p: P): Boolean
Link copied to clipboard
open fun addTerminator(@NotNull 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
fun forEach(action: Consumer<in Node<T>>)
Link copied to clipboard
abstract fun getDimensions(): Int
Link copied to clipboard
Link copied to clipboard
abstract fun getGlobalReactions(): ListSet<GlobalReaction<T>>
Link copied to clipboard
abstract fun getIncarnation(): Incarnation<T, P>
Link copied to clipboard
@Nullable
fun getLayer(@Nonnull molecule: Molecule): Layer<T, P>
Link copied to clipboard
fun getLayers(): ListSet<Layer<T, P>>
Link copied to clipboard
abstract fun getLinkingRule(): LinkingRule<T, P>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getNodes(): ListSet<Node<T>>
Link copied to clipboard
fun getNodesWithinRange(@Nonnull position: P, range: Double): ListSet<Node<T>>
fun getNodesWithinRange(@Nonnull node: Node<T>, range: Double): ListSet<Node<T>>
Link copied to clipboard
abstract fun getOffset(): Array<Double>
Link copied to clipboard
Link copied to clipboard
abstract fun getSimulation(): Simulation<T, P>
Link copied to clipboard
@Nullable
open fun getSimulationOrNull(): Simulation<T, P>
Link copied to clipboard
abstract fun getSize(): Array<Double>
Link copied to clipboard
Override this method if units measuring distance do not match with units used for coordinates.
Link copied to clipboard

Returns true the network is segmented, false otherwise.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun makePosition(p: Array<Number>): P
Link copied to clipboard
abstract fun moveNodeToPosition(p: Node<T>, p1: P)
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
Link copied to clipboard
fun removeNode(@Nonnull 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>)
Link copied to clipboard
Link copied to clipboard
open fun toString(): String
Not used internally.