ImageEnvironment

open class ImageEnvironment<T> : Continuous2DObstacles<T>

This environment loads an image from the file system, and marks as obstacles all the pixels of a given color.

Parameters

<T>

concentration type

Constructors

Link copied to clipboard
open fun ImageEnvironment(incarnation: Incarnation<T, Euclidean2DPosition>, path: String)
Link copied to clipboard
open fun ImageEnvironment(    incarnation: Incarnation<T, Euclidean2DPosition>,     path: String,     zoom: Double)
Link copied to clipboard
open fun ImageEnvironment(    incarnation: Incarnation<T, Euclidean2DPosition>,     path: String,     zoom: Double,     dx: Double,     dy: Double)
Link copied to clipboard
open fun ImageEnvironment(    incarnation: Incarnation<T, Euclidean2DPosition>,     obstacleColor: Int,     path: String,     zoom: Double,     dx: Double,     dy: Double)

Functions

Link copied to clipboard
open fun addGlobalReaction(reaction: GlobalReaction<T>)
Link copied to clipboard
fun addLayer(m: Molecule, l: Layer<T, P>)
Link copied to clipboard
fun addNode(node: Node<T>, p: P): Boolean
Link copied to clipboard
fun addObstacle(@Nonnull o: RectObstacle2D<Euclidean2DPosition>)
abstract fun addObstacle(p: W)
Link copied to clipboard
fun addTerminator(terminator: Predicate<Environment<T, P>>)
Link copied to clipboard
open fun farthestPositionReachable(    node: Node<T>,     desiredPosition: Euclidean2DPosition,     hitboxRadius: Double): Euclidean2DPosition
abstract fun farthestPositionReachable(    node: Node<T>,     desiredPosition: P,     hitboxRadius: Double): P
Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping.
Link copied to clipboard
fun forEach(action: Consumer<out Any>)
Link copied to clipboard
fun getDimensions(): Int
Link copied to clipboard
fun getDistanceBetweenNodes(n1: Node<T>, n2: Node<T>): Double
Link copied to clipboard
open fun getHeading(node: Node<T>): Euclidean2DPosition
abstract fun getHeading(node: Node<T>): P
Gets the heading of a node as a direction vector.
Link copied to clipboard
fun getLayer(m: Molecule): Optional<Layer<T, P>>
Link copied to clipboard
fun getLayers(): ListSet<Layer<T, P>>
Link copied to clipboard
fun getLinkingRule(): LinkingRule<T, P>
Link copied to clipboard
fun getNeighborhood(center: Node<T>): Neighborhood<T>
Link copied to clipboard
fun getNodeByID(id: Int): Node<T>
Link copied to clipboard
fun getNodeCount(): Int
Link copied to clipboard
open fun getNodesWithin(shape: GeometricShape<Euclidean2DPosition, Euclidean2DTransformation>): List<Node<T>>
Gets all nodes whose shape.intersect is true for the given shape.
Link copied to clipboard
fun getNodesWithinRange(center: Node<T>, range: Double): ListSet<Node<T>>
Link copied to clipboard
fun getObstacles(): List<RectObstacle2D<Euclidean2DPosition>>
abstract fun getObstacles(): List<W>
Link copied to clipboard
fun getObstaclesInRange(@Nonnull center: Euclidean2DPosition, range: Double): List<RectObstacle2D<Euclidean2DPosition>>
abstract fun getObstaclesInRange(center: Euclidean2DPosition, range: Double): List<W>
fun getObstaclesInRange(    centerx: Double,     centery: Double,     range: Double): List<RectObstacle2D<Euclidean2DPosition>>
Given a point and a range, retrieves all the obstacles within.
Link copied to clipboard
fun getOffset(): Array<Double>
Link copied to clipboard
open fun getOrigin(): Euclidean2DPosition
open fun getOrigin(): P
Link copied to clipboard
fun getPosition(node: Node<T>): P
Link copied to clipboard
open fun getShape(node: Node<T>): GeometricShape<Euclidean2DPosition, Euclidean2DTransformation>
abstract fun getShape(node: Node<T>): GeometricShape<P, A>
Gets the shape of a node relatively to its position and heading in the environment.
Link copied to clipboard
abstract fun getShapeFactory(): F
A factory of shapes compatible with this environment.
Link copied to clipboard
fun getSize(): Array<Double>
Link copied to clipboard
open fun getSizeInDistanceUnits(): Array<Double>
Link copied to clipboard
open fun hasMobileObstacles(): Boolean
Subclasses dealing with mobile obstacles may change this.
abstract fun hasMobileObstacles(): Boolean
Link copied to clipboard
fun intersectsObstacle(start: Euclidean2DPosition, end: Euclidean2DPosition): Boolean
abstract fun intersectsObstacle(p: P, p1: P): Boolean
Link copied to clipboard
fun isTerminated(): Boolean
Link copied to clipboard
fun iterator(): Iterator<Node<T>>
abstract fun iterator(): Iterator<T>
Link copied to clipboard
open fun makePosition(coordinates: Array<Number>): Euclidean2DPosition
Creates an euclidean position from the given coordinates.
abstract fun makePosition(p: Array<Number>): P
Link copied to clipboard
open fun moveNode(node: Node<T>, direction: P)
Link copied to clipboard
open fun moveNodeToPosition(node: Node<T>, newpos: P)

open fun moveNodeToPosition(node: Node<T>, newPosition: Euclidean2DPosition)
open fun moveNodeToPosition(node: Node<T>, newPos: Euclidean2DPosition)
Moves the node to the farthestPositionReachable towards the desired newPosition.
Link copied to clipboard
fun next(@Nonnull current: Euclidean2DPosition, @Nonnull desired: Euclidean2DPosition): Euclidean2DPosition
abstract fun next(p: P, p1: P): P

fun next(    ox: Double,     oy: Double,     nx: Double,     ny: Double): Euclidean2DPosition
This method must calculate the ABSOLUTE next allowed position given the current position and the position in which the node wants to move.
Link copied to clipboard
fun removeNode(node: Node<T>)
Link copied to clipboard
fun removeObstacle(@Nonnull o: RectObstacle2D<Euclidean2DPosition>): Boolean
abstract fun removeObstacle(p: W): Boolean
Link copied to clipboard
open fun setHeading(node: Node<T>, direction: Euclidean2DPosition)
Sets the heading of a node.
Link copied to clipboard
fun setLinkingRule(r: LinkingRule<T, P>)
Link copied to clipboard
fun spliterator(): Spliterator<Node<T>>
open fun spliterator(): Spliterator<T>
Link copied to clipboard
open fun toString(): String

Properties

Link copied to clipboard
val Companion: Continuous2DEnvironment.Companion
Link copied to clipboard
val DEFAULT_COLOR: Int
Default color to be parsed as obstacle.
Link copied to clipboard
val DEFAULT_DELTA_X: Double
Default X starting position.
Link copied to clipboard
val DEFAULT_DELTA_Y: Double
Default Y starting position.
Link copied to clipboard
val DEFAULT_ZOOM: Double
Default zoom level.
Link copied to clipboard
val globalReactions: ListSet<GlobalReaction<T>>
Link copied to clipboard
open val incarnation: Incarnation<T, P>
Link copied to clipboard
val nodes: ListSet<Node<T>>
Link copied to clipboard
val shapeFactory: Euclidean2DShapeFactory
A factory of shapes compatible with this environment.
Link copied to clipboard
open var simulation: Simulation<T, P>

Inheritors

Link copied to clipboard