Package repast.simphony.space.continuous
Class StrictBorders
- java.lang.Object
-
- repast.simphony.space.continuous.AbstractPointTranslator
-
- repast.simphony.space.continuous.StrictBorders
-
- All Implemented Interfaces:
PointTranslator
public class StrictBorders extends AbstractPointTranslator
Strict border implementation. Any translate or transform outside of the space's dimensions will throw a SpatialException.- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
-
Field Summary
-
Fields inherited from class repast.simphony.space.continuous.AbstractPointTranslator
dimensions
-
-
Constructor Summary
Constructors Constructor Description StrictBorders()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
translate(double[] location, double... displacement)
Translate the specified location by the specified displacement.void
translate(NdPoint location, double[] newLocation, double... displacement)
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).-
Methods inherited from class repast.simphony.space.continuous.AbstractPointTranslator
boundsCheck, init, minusEpsilon, transform, transform
-
-
-
-
Method Detail
-
isPeriodic
public 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.
-
translate
public 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). If the translated location is outside of the grid dimensions, then a SpatialException is thrown.- Parameters:
location
- the current locationdisplacement
- the amount to translate
-
translate
public void translate(NdPoint location, double[] newLocation, double... displacement)
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. If the translated location is outside of the grid dimensions, then a SpatialException is thrown.- Parameters:
location
- the current locationnewLocation
- this will hold the newLocation after the method has completeddisplacement
- the amount to translate
-
-