Image Environment
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)
Content copied to clipboard
Link copied to clipboard
open fun ImageEnvironment(incarnation: Incarnation<T, Euclidean2DPosition>, path: String, zoom: Double)
Content copied to clipboard
Link copied to clipboard
open fun ImageEnvironment(incarnation: Incarnation<T, Euclidean2DPosition>, path: String, zoom: Double, dx: Double, dy: Double)
Content copied to clipboard
Link copied to clipboard
open fun ImageEnvironment(incarnation: Incarnation<T, Euclidean2DPosition>, obstacleColor: Int, path: String, zoom: Double, dx: Double, dy: Double)
Content copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun farthestPositionReachable(node: NodeWithShape<T, out Any, out Any>, desiredPosition: Euclidean2DPosition, hitboxRadius: Double): Euclidean2DPosition
Content copied to clipboard
node.
abstract fun farthestPositionReachable(node: NodeWithShape<T, out Any, out Any>, desiredPosition: P, hitboxRadius: Double): P
Content copied to clipboard
Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Gets the heading of a node as a direction vector.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getNodesWithin(shape: GeometricShape<Euclidean2DPosition, Euclidean2DTransformation>): List<Node<T>>
Content copied to clipboard
Gets all nodes whose shape.intersect is true for the given shape.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getObstaclesInRange(@Nonnull center: Euclidean2DPosition, range: Double): List<RectObstacle2D<Euclidean2DPosition>>
Content copied to clipboard
abstract fun getObstaclesInRange(center: Euclidean2DPosition, range: Double): List<W>
Content copied to clipboard
fun getObstaclesInRange(centerx: Double, centery: Double, range: Double): List<RectObstacle2D<Euclidean2DPosition>>
Content copied to clipboard
Given a point and a range, retrieves all the obstacles within.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getShape(node: Node<T>): GeometricShape<Euclidean2DPosition, Euclidean2DTransformation>
Content copied to clipboard
Gets the shape of a node relatively to its position and heading in the environment.
Link copied to clipboard
A factory of shapes compatible with this environment.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Subclasses dealing with mobile obstacles may change this.
Link copied to clipboard
fun intersectsObstacle(start: Euclidean2DPosition, end: Euclidean2DPosition): Boolean
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
Creates an euclidean position from the given coordinates.
Link copied to clipboard
open fun moveNodeToPosition(node: Node<T>, newPosition: Euclidean2DPosition)
Content copied to clipboard
Link copied to clipboard
fun next(@Nonnull current: Euclidean2DPosition, @Nonnull desired: Euclidean2DPosition): Euclidean2DPosition
Content copied to clipboard
fun next(ox: Double, oy: Double, nx: Double, ny: Double): Euclidean2DPosition
Content copied to clipboard
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
Link copied to clipboard
fun removeObstacle(@Nonnull o: RectObstacle2D<Euclidean2DPosition>): Boolean
Content copied to clipboard
Link copied to clipboard
Sets the heading of a node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard