EnvironmentWithDynamics

class EnvironmentWithDynamics<T> @JvmOverloads constructor(incarnation: Incarnation<T, Euclidean2DPosition>, path: String? = null, zoom: Double = 1.0, dx: Double = 0.0, dy: Double = 0.0, obstaclesColor: Int = Color.BLACK.rgb, roomsColor: Int = Color.BLUE.rgb, backingEnvironment: Physics2DEnvironment<T> = path?.let { ImageEnvironmentWithGraph(incarnation, it, zoom, dx, dy, obstaclesColor, roomsColor) } ?: ContinuousPhysics2DEnvironment(incarnation)) : Dynamics2DEnvironment<T> , EuclideanPhysics2DEnvironmentWithObstacles<RectObstacle2D<Euclidean2DPosition>, T>

This Environment uses hooks provided by Dynamics2DEnvironment to update the physical world, It also applies physical properties to any added node to perform collision detection and response. If an image path is provided a backing ImageEnvironmentWithGraph is used, otherwise the Continuous2DEnvironment will be used.

Constructors

Link copied to clipboard
constructor(incarnation: Incarnation<T, Euclidean2DPosition>, path: String? = null, zoom: Double = 1.0, dx: Double = 0.0, dy: Double = 0.0, obstaclesColor: Int = Color.BLACK.rgb, roomsColor: Int = Color.BLUE.rgb, backingEnvironment: Physics2DEnvironment<T> = path?.let { ImageEnvironmentWithGraph(incarnation, it, zoom, dx, dy, obstaclesColor, roomsColor) } ?: ContinuousPhysics2DEnvironment(incarnation))

Properties

Link copied to clipboard
Link copied to clipboard
open override val origin: Euclidean2DPosition
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addGlobalReaction(reaction: GlobalReaction<T>)
Link copied to clipboard
open override fun addLayer(p0: Molecule, p1: Layer<T, Euclidean2DPosition>)
Link copied to clipboard
open override fun addNode(node: Node<T>, position: Euclidean2DPosition): Boolean
Link copied to clipboard
open override fun addObstacle(obstacle: RectObstacle2D<Euclidean2DPosition>)
Link copied to clipboard
Link copied to clipboard
open override fun farthestPositionReachable(node: Node<T>, desiredPosition: Euclidean2DPosition, hitboxRadius: Double): Euclidean2DPosition
Link copied to clipboard
open fun forEach(p0: Consumer<in Node<T>>)
Link copied to clipboard
open override fun getDimensions(): Int
Link copied to clipboard
open override fun getDistanceBetweenNodes(p0: Node<T>, p1: Node<T>): Double
Link copied to clipboard
open override fun getGlobalReactions(): ListSet<GlobalReaction<T>>
Link copied to clipboard
open override fun getHeading(node: Node<T>): Euclidean2DPosition
Link copied to clipboard
@Nonnull
open override fun getIncarnation(): Incarnation<T, Euclidean2DPosition>
Link copied to clipboard
Link copied to clipboard
open override fun getLayers(): ListSet<Layer<T, Euclidean2DPosition>>
Link copied to clipboard
Link copied to clipboard
open override fun getNeighborhood(p0: Node<T>): Neighborhood<T>
Link copied to clipboard
open override fun getNodeByID(p0: Int): Node<T>
Link copied to clipboard
open override fun getNodeCount(): Int
Link copied to clipboard
open override fun getNodes(): ListSet<Node<T>>
Link copied to clipboard
Link copied to clipboard
open override fun getNodesWithinRange(p0: Node<T>, p1: Double): ListSet<Node<T>>
open override fun getNodesWithinRange(p0: Euclidean2DPosition, p1: Double): ListSet<Node<T>>
Link copied to clipboard
Link copied to clipboard
open override fun getOffset(): DoubleArray
Link copied to clipboard
open override fun getPosition(node: Node<T>): Euclidean2DPosition
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getSize(): DoubleArray
Link copied to clipboard
open override fun getSizeInDistanceUnits(): DoubleArray
Link copied to clipboard
open override fun getVelocity(node: Node<T>): Euclidean2DPosition
Link copied to clipboard
open override fun hasMobileObstacles(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun isTerminated(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<Node<T>>
Link copied to clipboard
open override fun makePosition(vararg coordinates: Number): Euclidean2DPosition
open override fun makePosition(vararg coordinates: Double): Euclidean2DPosition
open override fun makePosition(x: Double, y: Double): Euclidean2DPosition
Link copied to clipboard
open override fun moveNode(node: Node<T>, direction: Euclidean2DPosition)
Link copied to clipboard
@Nonnull
open override fun moveNodeToPosition(@Nonnull p0: Node<T>, @Nonnull p1: Euclidean2DPosition)
Link copied to clipboard
open override fun next(current: Euclidean2DPosition, desired: Euclidean2DPosition): Euclidean2DPosition
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
open override fun removeGlobalReaction(p0: GlobalReaction<T>)
Link copied to clipboard
open override fun removeNode(p0: Node<T>)
Link copied to clipboard
Link copied to clipboard
open override fun setHeading(node: Node<T>, direction: Euclidean2DPosition)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun setVelocity(node: Node<T>, velocity: Euclidean2DPosition)
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 override fun updatePhysics(elapsedTime: Double)