Package HAL.GridsAndAgents
Class Grid1Dint
- java.lang.Object
-
- HAL.GridsAndAgents.Grid1Dint
-
- All Implemented Interfaces:
Grid1D
,java.io.Serializable
public class Grid1Dint extends java.lang.Object implements Grid1D, java.io.Serializable
a 1D Grid of ints- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description void
Add(int x, int val)
adds to the current field value at the specified indexvoid
AddAll(int val)
adds specified value to all entries of the curr fieldvoid
BoundAll(int min, int max)
Bounds all values in the current field between min and maxint
Get(int x)
gets the current field value at the specified indexint
GetAvg()
returns the mean value of the gridint[]
GetField()
returns the complete field as an arrayint
GetMax()
returns the max value in the gridint
GetMin()
returns the min value in the gridboolean
IsWrapX()
int
Length()
void
Scale(int x, double val)
multiplies the current field value at the specified indexvoid
ScaleAll(double val)
adds specified value to all entries of the curr fieldvoid
Set(int x, int val)
sets the current field value at the specified indexvoid
SetAll(int val)
sets all squares in current the field to the specified valuevoid
SetAll(int[] vals)
copies the array argument into the fieldint
Xdim()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface HAL.Interfaces.Grid1D
ApplyHood, ApplyHoodMapped, ApplyRectangle, ContainsValidI, DispX, Dist, DistSquared, GetHoodI, In, In, InWrap, InWrap, MapHood, MapHood, MapXpt, MapXsq, RandomHoodI, WrapI
-
-
-
-
Method Detail
-
Get
public int Get(int x)
gets the current field value at the specified index
-
GetField
public int[] GetField()
returns the complete field as an array
-
Set
public void Set(int x, int val)
sets the current field value at the specified index
-
Scale
public void Scale(int x, double val)
multiplies the current field value at the specified index
-
Add
public void Add(int x, int val)
adds to the current field value at the specified index
-
BoundAll
public void BoundAll(int min, int max)
Bounds all values in the current field between min and max
-
SetAll
public void SetAll(int val)
sets all squares in current the field to the specified value
-
AddAll
public void AddAll(int val)
adds specified value to all entries of the curr field
-
ScaleAll
public void ScaleAll(double val)
adds specified value to all entries of the curr field
-
SetAll
public void SetAll(int[] vals)
copies the array argument into the field
-
GetAvg
public int GetAvg()
returns the mean value of the grid
-
GetMax
public int GetMax()
returns the max value in the grid
-
GetMin
public int GetMin()
returns the min value in the grid
-
-