LimitedContinuos2D

This class represents a 2D continuous environment with spatial limitations. Those limitations will prevent nodes to move in positions which are not allowed.

Parameters

<T>

concentration type

Inheritors

Constructors

Link copied to clipboard
constructor(incarnation: Incarnation<T, Euclidean2DPosition>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A factory of shapes compatible with this environment.

Link copied to clipboard
open var simulation: Simulation<T, P>

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 addTerminator(terminator: Predicate<Environment<T, P>>)
Link copied to clipboard
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. If no node is located in between, desiredPosition is returned. Otherwise, the first position where the node collides with someone else is returned. For collision purposes, hitboxes are used: each node is given a circular hitbox of radius equal to its shape's radius (shapeless nodes can't cause overlapping). The client can specify a different radius for the hitbox of the moving node.

open fun farthestPositionReachable(node: Node<T>, desiredPosition: Euclidean2DPosition, hitboxRadius: Double): Euclidean2DPosition

Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping. If no node is located in between, desiredPosition is returned. Otherwise, the first position where the node collides with someone else is returned. For collision purposes, hitboxes are used: each node is given a circular hitbox of radius equal to its shape's radius (shapeless nodes can't cause overlapping). The client can specify a different radius for the hitbox of the moving node.

Link copied to clipboard
fun forEach(action: Consumer<in Node<T>>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getHeading(node: Node<T>): P

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
fun getNodeByID(id: Int): Node<T>
Link copied to clipboard
Link copied to clipboard

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
Link copied to clipboard
open fun getOrigin(): P
Link copied to clipboard
fun getPosition(node: Node<T>): P
Link copied to clipboard
abstract fun getShape(node: Node<T>): Shape<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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun makePosition(p: Array<Number>): P

open fun makePosition(coordinates: Array<Number>): Euclidean2DPosition

Creates an euclidean position from the given coordinates.

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(@Nonnull node: Node<T>, newPos: Euclidean2DPosition)
Moves the node to the farthestPositionReachable towards the desired newPosition.
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
Link copied to clipboard
fun removeNode(node: Node<T>)
Link copied to clipboard
open fun setHeading(node: Node<T>, direction: Euclidean2DPosition)

Sets the heading of a node.

Link copied to clipboard
Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

Link copied to clipboard
Link copied to clipboard
open fun toString(): String