Class EnvironmentWithDynamics
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.Environment
,it.unibo.alchemist.model.EnvironmentWithObstacles
,it.unibo.alchemist.model.EuclideanEnvironment
,it.unibo.alchemist.model.environments.Environment2DWithObstacles
,it.unibo.alchemist.model.environments.Euclidean2DEnvironment
,it.unibo.alchemist.model.environments.Euclidean2DEnvironmentWithObstacles
,it.unibo.alchemist.model.physics.PhysicsEnvironment
,it.unibo.alchemist.model.physics.environments.Dynamics2DEnvironment
,it.unibo.alchemist.model.physics.environments.EuclideanPhysics2DEnvironmentWithObstacles
,it.unibo.alchemist.model.physics.environments.Physics2DEnvironment
,java.io.Serializable
,kotlin.collections.Iterable
,kotlin.collections.MutableIterable
public final class EnvironmentWithDynamics<T extends Object> implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final Euclidean2DPosition
origin
private final Euclidean2DShapeFactory
shapeFactory
private final List<RectObstacle2D<Euclidean2DPosition>>
obstacles
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Euclidean2DPosition
getOrigin()
Unit
addGlobalReaction(GlobalReaction<T> reaction)
Boolean
addNode(Node<T> node, Euclidean2DPosition position)
Unit
moveNode(Node<T> node, Euclidean2DPosition direction)
Unit
setVelocity(Node<T> node, Euclidean2DPosition velocity)
Euclidean2DPosition
getVelocity(Node<T> node)
Unit
updatePhysics(Double elapsedTime)
Euclidean2DPosition
getPosition(Node<T> node)
Euclidean2DPosition
makePosition(Double coordinates)
-
Methods inherited from class it.unibo.alchemist.model.physics.PhysicsEnvironment
farthestPositionReachable, getHeading, getNodesWithin, getShape, getShapeFactory, setHeading
-
Methods inherited from class it.unibo.alchemist.model.EnvironmentWithObstacles
addObstacle, getObstacles, intersectsObstacle, next, removeObstacle
-
Methods inherited from class it.unibo.alchemist.model.Environment
addLayer, addTerminator, getDimensions, getDistanceBetweenNodes, getGlobalReactions, getIncarnation, getLayer, getLayers, getLinkingRule, getNeighborhood, getNodeByID, getNodeCount, getNodes, getNodesWithinRange, getNodesWithinRange, getOffset, getSimulation, getSize, getSizeInDistanceUnits, isTerminated, makePosition, moveNodeToPosition, removeGlobalReaction, removeNode, setLinkingRule, setSimulation
-
Methods inherited from class it.unibo.alchemist.model.environments.Euclidean2DEnvironment
makePosition
-
Methods inherited from class kotlin.collections.MutableIterable
iterator
-
Methods inherited from class it.unibo.alchemist.model.environments.Environment2DWithObstacles
getObstaclesInRange, getObstaclesInRange, hasMobileObstacles
-
Methods inherited from class kotlin.collections.Iterable
forEach, spliterator
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom, Double dx, Double dy, Integer obstaclesColor, Integer roomsColor, Physics2DEnvironment<T> backingEnvironment)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom, Double dx, Double dy, Integer obstaclesColor, Integer roomsColor)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom, Double dx, Double dy, Integer obstaclesColor)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom, Double dx, Double dy)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom, Double dx)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path, Double zoom)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation, String path)
-
EnvironmentWithDynamics
EnvironmentWithDynamics(Incarnation<T, Euclidean2DPosition> incarnation)
-
-
Method Detail
-
getOrigin
Euclidean2DPosition getOrigin()
-
addGlobalReaction
Unit addGlobalReaction(GlobalReaction<T> reaction)
-
addNode
Boolean addNode(Node<T> node, Euclidean2DPosition position)
-
moveNode
Unit moveNode(Node<T> node, Euclidean2DPosition direction)
-
setVelocity
Unit setVelocity(Node<T> node, Euclidean2DPosition velocity)
-
getVelocity
Euclidean2DPosition getVelocity(Node<T> node)
-
updatePhysics
Unit updatePhysics(Double elapsedTime)
-
getPosition
Euclidean2DPosition getPosition(Node<T> node)
-
makePosition
Euclidean2DPosition makePosition(Double coordinates)
-
-
-
-