ContinuousPhysics2DEnvironment

Constructors

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

Properties

Link copied to clipboard
override val dimensions: Int
Link copied to clipboard
@get:Nonnull
open override val globalReactions: ListSet<GlobalReaction<T>>
Link copied to clipboard
Link copied to clipboard
override val isTerminated: Boolean
Link copied to clipboard
@get:Nonnull
override val layers: ListSet<Layer<T, Euclidean2DPosition>>
Link copied to clipboard
Link copied to clipboard
override val nodeCount: Int
Link copied to clipboard
@get:Nonnull
override val nodes: ListSet<Node<T>>
Link copied to clipboard
override val offset: DoubleArray
Link copied to clipboard
open override val origin: Euclidean2DPosition
Link copied to clipboard

A factory of shapes compatible with this environment.

Link copied to clipboard
Link copied to clipboard
@get:Nullable
open override val simulationOrNull: Simulation<T, Euclidean2DPosition>?
Link copied to clipboard
override val size: DoubleArray
Link copied to clipboard
@get:Nonnull
open override val sizeInDistanceUnits: DoubleArray

Functions

Link copied to clipboard
open override fun addGlobalReaction(@Nonnull reaction: GlobalReaction<T>)
Link copied to clipboard
override fun addLayer(@Nonnull molecule: Molecule, @Nonnull layer: Layer<T, Euclidean2DPosition>)
Link copied to clipboard
override fun addNode(@Nonnull node: Node<T>, @Nonnull position: Euclidean2DPosition): Boolean
Link copied to clipboard
open override fun addTerminator(@NotNull terminator: TerminationPredicate<T, Euclidean2DPosition>)
Link copied to clipboard
open override 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
override fun forEach(p0: Consumer<in Node<T>>)
Link copied to clipboard
override fun getDistanceBetweenNodes(@Nonnull n1: Node<T>, @Nonnull n2: Node<T>): Double
Link copied to clipboard
open override fun getHeading(node: Node<T>): Euclidean2DPosition

Gets the heading of a node as a direction vector.

Link copied to clipboard
@Nullable
override fun getLayer(@Nonnull molecule: Molecule): Layer<T, Euclidean2DPosition>?
Link copied to clipboard
Link copied to clipboard
override fun getNodeByID(id: Int): Node<T>
Link copied to clipboard
open override fun getNodesWithin(shape: Euclidean2DShape): List<Node<T>>

Gets all nodes whose shape.intersect is true for the given shape.

Link copied to clipboard
override fun getNodesWithinRange(@Nonnull node: Node<T>, range: Double): ListSet<Node<T>>
override fun getNodesWithinRange(@Nonnull position: Euclidean2DPosition, range: Double): ListSet<Node<T>>
Link copied to clipboard
Link copied to clipboard
open override fun getShape(node: Node<T>): Euclidean2DShape

Gets the shape of a node relatively to its position and heading in the environment.

Link copied to clipboard
operator override fun iterator(): Iterator<Node<T>>
Link copied to clipboard
open fun makePosition(coordinates: List<Number>): Euclidean2DPosition

open override fun makePosition(vararg coordinates: Number): Euclidean2DPosition

Creates an euclidean position from the given coordinates.

Link copied to clipboard
open fun moveNode(node: Node<T>, direction: Euclidean2DPosition)
Link copied to clipboard
open override fun moveNodeToPosition(node: Node<T>, newPosition: Euclidean2DPosition)

Moves the node to the farthestPositionReachable towards the desired newPosition. If the node is shapeless, it is simply moved to newPosition.

Link copied to clipboard
open override fun removeGlobalReaction(@Nonnull reaction: GlobalReaction<T>)
Link copied to clipboard
override fun removeNode(@Nonnull node: Node<T>)
Link copied to clipboard
open override fun setHeading(node: Node<T>, direction: Euclidean2DPosition)

Sets the heading of a node.

Link copied to clipboard
override fun spliterator(): Spliterator<Node<T>>
Link copied to clipboard
open override fun toString(): String