EuclideanEnvironment

An Euclidean space, where Positions P are valid Vectors, supporting any concentration type T.

Inheritors

Properties

Link copied to clipboard
open val origin: P

Create a position corresponding to the origin of this environment.

Functions

Link copied to clipboard
abstract fun addGlobalReaction(reaction: GlobalReaction<T>)
Link copied to clipboard
abstract fun addLayer(m: Molecule, l: Layer<T, P>)

Add a Layer to the Environment.

Link copied to clipboard
abstract fun addNode(node: Node<T>, p: P): Boolean

This method allows to add a new node to this environment. The environment is responsible to call the right method of the simulation in order to ensure that the reaction is properly scheduled.

Link copied to clipboard
abstract fun addTerminator(terminator: Predicate<Environment<T, P>>)
Link copied to clipboard
abstract fun getDimensions(): Int

The number of dimensions of this environment.

Link copied to clipboard
abstract fun getDistanceBetweenNodes(n1: Node<T>, n2: Node<T>): Double

Measures the distance between two nodes in the environment.

Link copied to clipboard
abstract fun getGlobalReactions(): ListSet<GlobalReaction<T>>
Link copied to clipboard
@Nonnull
abstract fun getIncarnation(): Incarnation<T, P>
Link copied to clipboard
abstract fun getLayer(m: Molecule): Optional<Layer<T, P>>

Get the layer associate to the given molecule. If no Layer is associated with the given molecule, return an empty optional.

Link copied to clipboard
abstract fun getLayers(): ListSet<Layer<T, P>>

Return all the Layers in this Environment.

Link copied to clipboard
abstract fun getLinkingRule(): LinkingRule<T, P>
Link copied to clipboard
abstract fun getNeighborhood(center: Node<T>): Neighborhood<T>

Given a node, this method returns its neighborhood.

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

Allows to access a node 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
abstract fun getNodeCount(): Int
Link copied to clipboard
abstract fun getNodes(): ListSet<Node<T>>

All the nodes that exist in current environment.

Link copied to clipboard
abstract fun getNodesWithinRange(center: P, range: Double): ListSet<Node<T>>

Given a Position(center) 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.

abstract fun getNodesWithinRange(center: Node<T>, range: Double): ListSet<Node<T>>

Given a node (center) 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 getNeighborhood and filter the neighborhood if you are sure that all the nodes within the range are connected to the center.

Link copied to clipboard
abstract fun getOffset(): DoubleArray

This method allows to know which are the smallest coordinates represented.

Link copied to clipboard
@Nonnull
abstract fun getPosition(node: Node<T>): P

Calculates the position of a node.

Link copied to clipboard
abstract fun getSimulation(): Simulation<T, P>
Link copied to clipboard
abstract fun getSize(): DoubleArray

This method returns the size of the environment as an array of length getDimensions. This method must return distance measured with the same unit used by the positions. No non-euclidean distance metrics are allowed.

Link copied to clipboard

This method returns the size of the environment as an array of length getDimensions. This method must return distance measured with the same unit used for measuring distances. It may or may not return the same result of getSize

Link copied to clipboard
abstract fun isTerminated(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): MutableIterator<Node<T>>
Link copied to clipboard
abstract fun makePosition(vararg coordinates: Number): P

abstract fun makePosition(vararg coordinates: Double): P

Creates a Position compatible with this environment given its coordinates.

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

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
@Nonnull
abstract fun moveNodeToPosition(@Nonnull node: Node<T>, @Nonnull position: P)

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

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

Remove a GlobalReaction from the Environment.

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

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

Link copied to clipboard
abstract fun setLinkingRule(rule: LinkingRule<T, P>)
Link copied to clipboard
abstract fun setSimulation(s: Simulation<T, P>)