Package repast.simphony.space.continuous
Interface PointTranslator
- All Known Subinterfaces:
PointTranslatorDecorator
- All Known Implementing Classes:
AbstractPointTranslator
,BouncyBorders
,InfiniteBorders
,StickyBorders
,StrictBorders
,WrapAroundBorders
public interface PointTranslator
Interface for classes that will translate a point by some specified amount.
- Author:
- Nick Collier
-
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(Dimensions dimensions) Initializes this with the given dimensions.boolean
True if this translator is periodic (in the sense that moving off one border makes you appear on the other one), otherwise false.void
transform
(double[] transformedLocation, double... targetLocation) Transform the given targetLocation according to this PointTranslator's semantics.void
Transform the given targetLocation according to this PointTranslator's semantics.void
translate
(double[] location, double... displacement) Translate the specified location by the specified displacement.void
Translate the specified location by the specified displacement.For example, if the location is (3, 4) and the displacement is (1, -2), the new location will be (4, 2).
-
Method Details
-
init
Initializes this with the given dimensions.- Parameters:
dimensions
- the dimensions of the space
-
translate
void translate(double[] location, double... displacement) Translate the specified location by the specified displacement. The new location will stored in the location array. For example, if the location is (3, 4) and the displacement is (1, -2), the new location will be (4, 2).- Parameters:
location
- the current locationdisplacement
- the amount to translate
-
translate
Translate the specified location by the specified displacement.For example, if the location is (3, 4) and the displacement is (1, -2), the new location will be (4, 2). The new location will be copied into the newLocation array.- Parameters:
location
- the current locationnewLocation
- this will hold the newLocation after the method has completeddisplacement
- the amount to translate
-
transform
void transform(double[] transformedLocation, double... targetLocation) Transform the given targetLocation according to this PointTranslator's semantics. The new transformed coordinates will be placed in the transformedTargetLocation.- 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.
-
transform
Transform the given targetLocation according to this PointTranslator's semantics. The new transformed coordinates will be placed in the transformedTargetLocation.- Parameters:
transformedLocation
- the coordinates once they have been transformed by this GridPointTranslatortargetLocation
- the new target transformedLocation whose coordinates will be transformed- Throws:
SpatialException
- if the transform is invalid. For example, if the new transformedLocation is outside of the grid.
-
isPeriodic
boolean isPeriodic()True if this translator is periodic (in the sense that moving off one border makes you appear on the other one), otherwise false.- Returns:
- true if this translator is periodic, otherwise false.
-