Class ContinuousValueLayer

java.lang.Object
repast.simphony.valueLayer.ContinuousValueLayer
All Implemented Interfaces:
ValueLayer

public class ContinuousValueLayer extends Object implements 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 Details

    • name

      protected String name
    • dims

      protected Dimensions dims
    • defaultValue

      protected double defaultValue
    • locationMap

      protected Map<NdPoint,Double> locationMap
    • dense

      protected boolean dense
    • translator

      protected PointTranslator translator
  • Constructor Details

    • ContinuousValueLayer

      public ContinuousValueLayer(String name, double... dimensions)
      Creates a continuous value layer withe specified name and dimensions.
      Parameters:
      name - the name of the value layer
      dimensions - the dimensions of the value layer
    • ContinuousValueLayer

      public ContinuousValueLayer(String name, boolean dense, double... dimensions)
      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 layer
      dense - dummy argument
      dimensions - the dimension of the value layer
    • ContinuousValueLayer

      public ContinuousValueLayer(String name, double defaultValue, boolean dense, double... dimensions)
      Creates a ContinuousValueLayer with the specified name, density, defaultValue and dimensions. The default border behavior is strict.
      Parameters:
      name - the name of the value layer
      defaultValue - the default value that a location will contain if it has not been set yet
      dense - dummy argument
      dimensions - 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 layer
      dense - dummy argument
      translator - the translator used
      dimensions - 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 layer
      defaultVal - the default value that each cell will contain if it has not been set yet
      dense - dummy argument
      translator - the translator used
      dimensions - 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 interface ValueLayer
      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 cell
      coordinate - the coordinate of the cell whose value we want to set
    • getLocation

      protected double[] getLocation(double... location)
    • getName

      public String getName()
      Gets the name of this value layer.
      Specified by:
      getName in interface ValueLayer
      Returns:
      the name of this value layer.
    • getDimensions

      public Dimensions getDimensions()
      Gets the dimensions of this value layer.
      Specified by:
      getDimensions in interface ValueLayer
      Returns:
      the dimensions of this value layer.
    • getPointTranslator

      public PointTranslator 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

      public void setPointTranslator(PointTranslator rule)
      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