Class GridLayer

java.lang.Object
org.baseagent.grid.GridLayer
All Implemented Interfaces:
Iterable<GridCell>

public class GridLayer extends Object implements Iterable<GridCell>
  • Constructor Details

  • Method Details

    • setParentGrid

      public void setParentGrid(Grid parentGrid)
    • getLayerName

      public String getLayerName()
    • getParentGrid

      public Grid getParentGrid()
    • current

      public GridLayerStep current()
    • next

      public GridLayerStep next()
    • getUpdateOption

      public GridLayer.GridLayerUpdateOption getUpdateOption()
    • setUpdateOption

      public void setUpdateOption(GridLayer.GridLayerUpdateOption updateOption)
    • persist

      public void persist(Object value, int x, int y)
    • iterator

      public Iterator<GridCell> iterator()
      Specified by:
      iterator in interface Iterable<GridCell>
    • fill

      public void fill(Object value)
    • fill

      public void fill(Object value, int x1, int y1, int x2, int y2)
    • laplacian_3x3

      public double laplacian_3x3(int x, int y, double centerWeight, double adjacentWeight, double diagonalWeight)
    • set

      public void set(int x, int y, Object value)
    • set

      public void set(GridPosition position, Object value)
    • clear

      public void clear(int x, int y)
    • clear

      public void clear(GridPosition position)
    • get

      public Object get(int x, int y)
    • get

      public Object get(GridPosition position)
    • count8Neighbors

      public int count8Neighbors(int x, int y, Predicate<? super Object> predicate)
    • count4Neighbors

      public int count4Neighbors(int x, int y, Predicate<? super Object> predicate)
    • average9Neighbors

      public double average9Neighbors(int x, int y)
    • average8Neighbors

      public double average8Neighbors(int x, int y)
    • average4Neighbors

      public double average4Neighbors(int x, int y)
    • count

      public long count(Predicate<Object> predicate)
    • getBooleanAsOneOrZero

      public int getBooleanAsOneOrZero(int x, int y, Predicate<? super Object> predicate)
    • scatter

      public void scatter(Object thing)
    • scatter

      public void scatter(Object thing, int howMany)
    • scatter

      public void scatter(Object thing, int howMany, int x1, int y1, int x2, int y2)
    • scatter

      public void scatter(List<? super Object> things)
    • scatter

      public void scatter(List<? super Object> things, int x1, int y1, int x2, int y2)
    • form

      public void form(Object thing, int x, int y, String... strings)
    • getRandomUnoccupiedPosition

      public GridPosition getRandomUnoccupiedPosition()
    • debug

      public void debug(PrintStream s)