Package repast.simphony.space.continuous
Class AbstractPointTranslator
- java.lang.Object
-
- repast.simphony.space.continuous.AbstractPointTranslator
-
- All Implemented Interfaces:
PointTranslator
- Direct Known Subclasses:
BouncyBorders
,StickyBorders
,StrictBorders
,WrapAroundBorders
public abstract class AbstractPointTranslator extends Object implements PointTranslator
Implements transform according to default continuous space moveTo semantics. Namely, transform will throw a SpatialException if the target location is off the grid.- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Field Summary
Fields Modifier and Type Field Description protected Dimensions
dimensions
-
Constructor Summary
Constructors Constructor Description AbstractPointTranslator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
boundsCheck(int i, double value)
void
init(Dimensions dimensions)
Initializes this with the given dimensions.protected static double
minusEpsilon(double amount)
void
transform(double[] transformedLocation, double... targetLocation)
Transform the given targetLocation according to default moveTo semantics.void
transform(NdPoint transformedLocation, double... targetLocation)
Transform the given targetLocation according to default moveTo semantics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface repast.simphony.space.continuous.PointTranslator
isPeriodic, translate, translate
-
-
-
-
Field Detail
-
dimensions
protected transient Dimensions dimensions
-
-
Method Detail
-
init
public void init(Dimensions dimensions)
Initializes this with the given dimensions.- Specified by:
init
in interfacePointTranslator
- Parameters:
dimensions
- the dimensions of the space
-
transform
public void transform(double[] transformedLocation, double... targetLocation) throws SpatialException
Transform the given targetLocation according to default moveTo semantics. Namely, if the target location is within the grid dimensions then that location becomes the new transformedLocation. Otherwise, this will throw a SpatialException.- Specified by:
transform
in interfacePointTranslator
- Parameters:
transformedLocation
- the coordinates once they have been transformed by this GridPointTranslatortargetLocation
- the new target location whose coordinates will be transformed- Throws:
SpatialException
- if the transform is invalid. For example, if the new location is outside of the grid.
-
boundsCheck
protected void boundsCheck(int i, double value)
-
transform
public void transform(NdPoint transformedLocation, double... targetLocation) throws SpatialException
Transform the given targetLocation according to default moveTo semantics. Namely, if the target location is within the grid dimensions then that location becomes the new transformedLocation. Otherwise, this will throw a SpatialException.- Specified by:
transform
in interfacePointTranslator
- Parameters:
transformedLocation
- the coordinates once they have been transformed by this GridPointTranslatortargetLocation
- the new target location whose coordinates will be transformed- Throws:
SpatialException
- if the transform is invalid. For example, if the new location is outside of the grid.
-
minusEpsilon
protected static double minusEpsilon(double amount)
-
-