Package HAL.GridsAndAgents
Class PopulationGridBase
- java.lang.Object
-
- HAL.GridsAndAgents.PopulationGridBase
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>
- Direct Known Subclasses:
PopulationGrid1D
,PopulationGrid2D
,PopulationGrid3D
public class PopulationGridBase extends java.lang.Object implements java.lang.Iterable<java.lang.Integer>
-
-
Field Summary
Fields Modifier and Type Field Description int
length
boolean
usingSparseIndices
-
Constructor Summary
Constructors Constructor Description PopulationGridBase(int length)
-
Method Summary
Modifier and Type Method Description void
Add(int i, int val)
void
AddTo(int[] dest)
void
AddTo(Grid2Dint dest)
void
ApplyOccupied(IndexIntAction Action)
void
CopyTo(int[] dest)
void
CopyTo(Grid2Dint dest)
int
Get(int i)
java.util.Iterator<java.lang.Integer>
iterator()
int
OccupiedArea()
long
Pop()
void
Set(int i, int val)
void
SetAll(int val)
void
SetupSparseIndices()
void
Update()
int
UpdateCt()
-
-
-
Method Detail
-
Add
public void Add(int i, int val)
-
Set
public void Set(int i, int val)
-
SetAll
public void SetAll(int val)
-
Pop
public long Pop()
-
OccupiedArea
public int OccupiedArea()
-
UpdateCt
public int UpdateCt()
-
Get
public int Get(int i)
-
ApplyOccupied
public void ApplyOccupied(IndexIntAction Action)
-
Update
public void Update()
-
SetupSparseIndices
public void SetupSparseIndices()
-
iterator
public java.util.Iterator<java.lang.Integer> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Integer>
-
AddTo
public void AddTo(int[] dest)
-
AddTo
public void AddTo(Grid2Dint dest)
-
CopyTo
public void CopyTo(int[] dest)
-
CopyTo
public void CopyTo(Grid2Dint dest)
-
-