Package repast.simphony.valueLayer
Class ContinuousValueLayer
java.lang.Object
repast.simphony.valueLayer.ContinuousValueLayer
- All Implemented Interfaces:
ValueLayer
A continuous value layer. Each point in the space is accessed via double x, y,
z, ... n coordinates and contains some numeric value.
- Author:
- Eric Tatara
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected boolean
protected Dimensions
protected String
protected PointTranslator
-
Constructor Summary
ConstructorDescriptionContinuousValueLayer
(String name, boolean dense, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, and dimensions.ContinuousValueLayer
(String name, boolean dense, PointTranslator translator, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, translator, and dimensions.ContinuousValueLayer
(String name, double... dimensions) Creates a continuous value layer withe specified name and dimensions.ContinuousValueLayer
(String name, double defaultValue, boolean dense, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, defaultValue and dimensions.ContinuousValueLayer
(String name, double defaultVal, boolean dense, PointTranslator translator, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, defaultValue, translator, and dimensions. -
Method Summary
Modifier and TypeMethodDescriptiondouble
get
(double... coordinates) Gets a value given the specified coordinates.Gets the dimensions of this value layer.protected double[]
getLocation
(double... location) getName()
Gets the name of this value layer.Retrieves the rule being used for controlling what happens at or beyond the borders of the value layer.void
set
(double value, double... coordinate) Sets the specified point to the specified value.void
Sets the rule to use for controlling what happens at or beyond the borders of the value layer.
-
Field Details
-
name
-
dims
-
defaultValue
protected double defaultValue -
locationMap
-
dense
protected boolean dense -
translator
-
-
Constructor Details
-
ContinuousValueLayer
Creates a continuous value layer withe specified name and dimensions.- Parameters:
name
- the name of the value layerdimensions
- the dimensions of the value layer
-
ContinuousValueLayer
Creates a ContinuousValueLayer with the specified name, density, and dimensions. The default value of every cell in the grid will be 0. The default border behavior is strict.- Parameters:
name
- the name of the value layerdense
- dummy argumentdimensions
- the dimension of the value layer
-
ContinuousValueLayer
Creates a ContinuousValueLayer with the specified name, density, defaultValue and dimensions. The default border behavior is strict.- Parameters:
name
- the name of the value layerdefaultValue
- the default value that a location will contain if it has not been set yetdense
- dummy argumentdimensions
- the dimension of the value layer
-
ContinuousValueLayer
public ContinuousValueLayer(String name, boolean dense, PointTranslator translator, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, translator, and dimensions. The default value of every cell in the grid will be 0.- Parameters:
name
- the name of the value layerdense
- dummy argumenttranslator
- the translator useddimensions
- the dimension of the value layer
-
ContinuousValueLayer
public ContinuousValueLayer(String name, double defaultVal, boolean dense, PointTranslator translator, double... dimensions) Creates a ContinuousValueLayer with the specified name, density, defaultValue, translator, and dimensions.- Parameters:
name
- the name of the value layerdefaultVal
- the default value that each cell will contain if it has not been set yetdense
- dummy argumenttranslator
- the translator useddimensions
- the dimension of the value layer
-
-
Method Details
-
get
public double get(double... coordinates) Gets a value given the specified coordinates. This assumes the coordinates are double x, y, z, n values.- Specified by:
get
in interfaceValueLayer
- Parameters:
coordinates
- the coordinates used to return the value.- Returns:
- a value given the specified coordinates.
-
set
public void set(double value, double... coordinate) Sets the specified point to the specified value.- Parameters:
value
- the new value of the cellcoordinate
- the coordinate of the cell whose value we want to set
-
getLocation
protected double[] getLocation(double... location) -
getName
Gets the name of this value layer.- Specified by:
getName
in interfaceValueLayer
- Returns:
- the name of this value layer.
-
getDimensions
Gets the dimensions of this value layer.- Specified by:
getDimensions
in interfaceValueLayer
- Returns:
- the dimensions of this value layer.
-
getPointTranslator
Retrieves the rule being used for controlling what happens at or beyond the borders of the value layer.- Returns:
- the rule for handling out of bounds coordinates
-
setPointTranslator
Sets the rule to use for controlling what happens at or beyond the borders of the value layer.- Parameters:
rule
- the rule for handling out of bounds coordinates
-