Package HAL.GridsAndAgents
Class Grid3Dobject<T>
- java.lang.Object
-
- HAL.GridsAndAgents.Grid3Dobject<T>
-
- All Implemented Interfaces:
Grid3D
,java.io.Serializable
public class Grid3Dobject<T> extends java.lang.Object implements Grid3D, java.io.Serializable
a 3D Grid of objects- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Grid3Dobject(int xDim, int yDim, int zDim)
creates a new Grid3Dojbect of dimensions xDim by yDim by zDim with optional wraparoundGrid3Dobject(int xDim, int yDim, int zDim, boolean wrapX, boolean wrapY, boolean wrapZ)
creates a new Grid3Dobject of dimensions xDim by yDim by zDim without wraparound
-
Method Summary
Modifier and Type Method Description T
Get(int i)
gets the field value at the specified indexT
Get(int x, int y, int z)
gets the field value at the specified coordinatesT[]
GetField()
returns the complete field as an arrayboolean
IsWrapX()
boolean
IsWrapY()
boolean
IsWrapZ()
int
Length()
void
Set(int x, int y, int z, T val)
sets the current field value at the specified coordinatesvoid
Set(int i, T val)
sets the current field value at the specified indexvoid
SetAll(T val)
sets all squares in current the field to the specified valueint
Xdim()
int
Ydim()
int
Zdim()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface HAL.Interfaces.Grid3D
ApplyHood, ApplyHood, ApplyHoodMapped, ApplyRectangle, BoundaryIs, ContainsValidI, ContainsValidI, ConvI, ConvXpt, ConvXsq, ConvYpt, ConvYsq, ConvZpt, ConvZsq, DispX, DispY, DispZ, Dist, DistSquared, GetHoodI, I, I, In, In, InWrap, InWrap, ItoX, ItoY, ItoZ, MapHood, MapHood, MapHood, MapHood, RandomHoodI, WrapI
-
-
-
-
Constructor Detail
-
Grid3Dobject
public Grid3Dobject(int xDim, int yDim, int zDim, boolean wrapX, boolean wrapY, boolean wrapZ)
creates a new Grid3Dobject of dimensions xDim by yDim by zDim without wraparound
-
Grid3Dobject
public Grid3Dobject(int xDim, int yDim, int zDim)
creates a new Grid3Dojbect of dimensions xDim by yDim by zDim with optional wraparound
-
-
Method Detail
-
Get
public T Get(int i)
gets the field value at the specified index
-
Get
public T Get(int x, int y, int z)
gets the field value at the specified coordinates
-
Set
public void Set(int i, T val)
sets the current field value at the specified index
-
Set
public void Set(int x, int y, int z, T val)
sets the current field value at the specified coordinates
-
GetField
public T[] GetField()
returns the complete field as an array
-
SetAll
public void SetAll(T val)
sets all squares in current the field to the specified value
-
-