EnvironmentWithObstacles

interface EnvironmentWithObstacles<W : Obstacle<P>, T, P : Position<P>, Vector<P>> : EuclideanEnvironment<T, P>

An environment with Obstacles.

Parameters

W

the type of obstacles.

T

the concentration type.

P

the position and vector type for this environment.

Functions

Link copied to clipboard
abstract fun addLayer(m: Molecule, l: Layer<T, P>)
Link copied to clipboard
abstract fun addNode(node: Node<T>, p: P)
Link copied to clipboard
abstract fun addObstacle(obstacle: W)

Adds an obstacle to this environment.

Link copied to clipboard
abstract fun addTerminator(terminator: Predicate<Environment<T, P>>)
Link copied to clipboard
open fun forEach(p0: Consumer<in Node<T>>)
Link copied to clipboard
abstract fun getDimensions(): Int
Link copied to clipboard
abstract fun getDistanceBetweenNodes(n1: Node<T>, n2: Node<T>): Double
Link copied to clipboard
abstract fun getIncarnation(): Optional<Incarnation<T, P>>
Link copied to clipboard
abstract fun getLayer(m: Molecule): Optional<Layer<T, P>>
Link copied to clipboard
abstract fun getLayers(): ListSet<Layer<T, P>>
Link copied to clipboard
abstract fun getLinkingRule(): LinkingRule<T, P>
Link copied to clipboard
abstract fun getNeighborhood(center: Node<T>): Neighborhood<T>
Link copied to clipboard
abstract 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(center: P, range: Double): ListSet<Node<T>>
abstract fun getNodesWithinRange(center: Node<T>, range: Double): ListSet<Node<T>>
Link copied to clipboard
abstract fun getOffset(): DoubleArray
Link copied to clipboard
abstract fun getPosition(node: Node<T>): P
Link copied to clipboard
abstract fun getSimulation(): Simulation<T, P>
Link copied to clipboard
abstract fun getSize(): DoubleArray
Link copied to clipboard
abstract fun getSizeInDistanceUnits(): DoubleArray
Link copied to clipboard
abstract fun intersectsObstacle(start: P, end: P): Boolean

Checks whether there is at least an obstacle intersecting the line connecting start and end.

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
abstract fun moveNodeToPosition(node: Node<T>, position: P)
Link copied to clipboard
abstract fun next(current: P, desired: P): P

This method must calculate the ABSOLUTE next allowed position given the current position and the position in which the node wants to move. For example, if your node is in position 2,3, wants to move to 3,4 but the next allowed position (because, e.g., of physical obstacles) is 2.5,3.5, the result must be a Position containing coordinates 2.5,3.5.

Link copied to clipboard
abstract fun removeNode(node: Node<T>)
Link copied to clipboard
abstract fun removeObstacle(obstacle: W): Boolean

Removes an obstacle from this environment.

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

Properties

Link copied to clipboard
abstract val obstacles: List<W>

A list of all the obstacles in this environment.

Link copied to clipboard
open val origin: P

Create a position corresponding to the origin of this environment.

Inheritors

Link copied to clipboard
Link copied to clipboard