-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Environment,it.unibo.alchemist.model.interfaces.EnvironmentWithObstacles,it.unibo.alchemist.model.interfaces.EuclideanEnvironment,it.unibo.alchemist.model.interfaces.EuclideanEnvironment,it.unibo.alchemist.model.interfaces.environments.Environment2DWithObstacles,it.unibo.alchemist.model.interfaces.environments.Euclidean2DEnvironment,it.unibo.alchemist.model.interfaces.environments.Euclidean2DEnvironmentWithObstacles,it.unibo.alchemist.model.interfaces.environments.EuclideanPhysics2DEnvironmentWithObstacles,it.unibo.alchemist.model.interfaces.environments.Physics2DEnvironment,it.unibo.alchemist.model.interfaces.environments.PhysicsEnvironment,java.io.Serializable,java.lang.Iterable
public class ImageEnvironment<T> extends Continuous2DObstacles<T>
This environment loads an image from the file system, and marks as obstacles all the pixels of a given color.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intDEFAULT_COLORpublic final static doubleDEFAULT_ZOOMpublic final static doubleDEFAULT_DELTA_Xpublic final static doubleDEFAULT_DELTA_Y
-
Constructor Summary
Constructors Constructor Description ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path)ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path, double zoom)ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path, double zoom, double dx, double dy)ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, int obstacleColor, String path, double zoom, double dx, double dy)
-
Method Summary
Modifier and Type Method Description -
Methods inherited from class it.unibo.alchemist.model.implementations.environments.Continuous2DObstacles
addObstacle, getObstacles, getObstaclesInRange, getObstaclesInRange, hasMobileObstacles, intersectsObstacle, next, next, removeObstacle -
Methods inherited from class it.unibo.alchemist.model.implementations.environments.LimitedContinuos2D
moveNodeToPosition -
Methods inherited from class it.unibo.alchemist.model.implementations.environments.Continuous2DEnvironment
farthestPositionReachable, getHeading, getNodesWithin, getShape, getShapeFactory, makePosition, moveNodeToPosition, setHeading -
Methods inherited from class it.unibo.alchemist.model.implementations.environments.Abstract2DEnvironment
getDimensions, getOffset, getSize, moveNodeToPosition -
Methods inherited from class it.unibo.alchemist.model.implementations.environments.AbstractEnvironment
addLayer, addNode, addTerminator, forEach, getDistanceBetweenNodes, getIncarnation, getLayer, getLayers, getLinkingRule, getNeighborhood, getNodeByID, getNodeCount, getNodes, getNodesWithinRange, getPosition, getSimulation, getSizeInDistanceUnits, isTerminated, iterator, removeNode, setLinkingRule, setSimulation, spliterator, toString -
Methods inherited from class it.unibo.alchemist.model.interfaces.Environment
makePosition -
Methods inherited from class java.lang.Iterable
iterator, spliterator -
Methods inherited from class it.unibo.alchemist.model.interfaces.environments.Euclidean2DEnvironment
getOrigin, makePosition -
Methods inherited from class it.unibo.alchemist.model.interfaces.EuclideanEnvironment
getOrigin, moveNode -
Methods inherited from class it.unibo.alchemist.model.interfaces.environments.PhysicsEnvironment
farthestPositionReachable, getHeading, getNodesWithin, getShape, getShapeFactory -
Methods inherited from class it.unibo.alchemist.model.interfaces.environments.Environment2DWithObstacles
getObstaclesInRange, hasMobileObstacles -
Methods inherited from class it.unibo.alchemist.model.interfaces.EnvironmentWithObstacles
addObstacle, getObstacles, intersectsObstacle, next, removeObstacle -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ImageEnvironment
ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path)
- Parameters:
incarnation- the incarnation to be used.path- the path where to load the image.
-
ImageEnvironment
ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path, double zoom)
- Parameters:
incarnation- the incarnation to be used.path- the path where to load the image.zoom- zoom level
-
ImageEnvironment
ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, String path, double zoom, double dx, double dy)
- Parameters:
incarnation- the incarnation to be used.path- the path where to load the image.zoom- zoom leveldx- delta X positiondy- delta Y position
-
ImageEnvironment
ImageEnvironment(Incarnation<T, Euclidean2DPosition> incarnation, int obstacleColor, String path, double zoom, double dx, double dy)
- Parameters:
incarnation- the incarnation to be used.obstacleColor- integer representing the RGB color to use as color for the obstacle detection in image.path- the path where to load the image.zoom- zoom leveldx- delta X positiondy- delta Y position
-
-
-
-