Class MemoryMatrix

java.lang.Object
  extended byswarm.BaseImpl
      extended byswarm.objectbase.SwarmObjectImpl
          extended byMemoryMatrix
All Implemented Interfaces:
swarm.defobj.Create, swarm.defobj.CreateS, swarm.defobj.Customize, swarm.defobj.CustomizeS, swarm.defobj.DefinedObject, swarm.defobj.DefinedObjectS, swarm.defobj.Drop, swarm.defobj.DropS, swarm.defobj.GetName, swarm.defobj.GetNameS, swarm.objectbase.SwarmObject, swarm.objectbase.SwarmObjectS

public class MemoryMatrix
extends swarm.objectbase.SwarmObjectImpl

The class of the memory matrixes (layered) used by the computational objects included in recipes

Author:
Pietro Terna

Field Summary
 int currentLayer
          layer to be used
 float[][] matrix
          the memory matrix
 swarm.collections.ArrayImpl matrixArray
          the array of matrixes built one for each layer, if layers are > 1 and sensitive==true
 int memoryMatrixNumber
          the number identifying the memory matrix (starting from zero) this number represents also the posizione of this memory matrix in an array of memory matrixes created and managed by ESFrameModelSwarm
 int numberOfCols
          the numberOfCols of matrix
 int numberOfRows
          the numberOfRows of matrix
 boolean printMatrixes
          print matrix option
 boolean sensitive
          is the unit sensitive to layers?
 float[][] shadowMatrix
          the shadow memory matrix
 swarm.collections.ArrayImpl shadowMatrixArray
          the array of shadow matrixes built one for each layer, if layers are > 1 and sensitive==true
 int totalLayerNumber
          the number of layers in the simulation
 
Constructor Summary
MemoryMatrix(swarm.defobj.Zone aZone, int n, boolean s, int tln, int nor, int noc, boolean pm)
          the constructor for MemoryMatrix
 
Method Summary
 boolean getEmpty(int layer, int row, int col)
          checking if a position in a matrix is empty
 int getMemoryMatrixNumber()
          returning the number of the matrix
 int getNumberOfCols()
          returning the number of cols
 int getNumberOfRows()
          returning the number of rows
 float getValue(int layer, int row, int col)
          getting a value
 void print()
          printing the matrix on the current terminal
 void setEmpty(int layer, int row, int col)
          setting a position in a matrix as empty
 void setValue(int layer, int row, int col, double value)
          setting a value (double)
 void setValue(int layer, int row, int col, float value)
          setting a value (float)
 
Methods inherited from class swarm.objectbase.SwarmObjectImpl
compare, describe, describeID, drop, getCompleteProbeMap, getDisplayName, getName, getProbeForMessage, getProbeForVariable, getProbeMap, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memoryMatrixNumber

public int memoryMatrixNumber
the number identifying the memory matrix (starting from zero) this number represents also the posizione of this memory matrix in an array of memory matrixes created and managed by ESFrameModelSwarm


totalLayerNumber

public int totalLayerNumber
the number of layers in the simulation


currentLayer

public int currentLayer
layer to be used


sensitive

public boolean sensitive
is the unit sensitive to layers?


matrixArray

public swarm.collections.ArrayImpl matrixArray
the array of matrixes built one for each layer, if layers are > 1 and sensitive==true


matrix

public float[][] matrix
the memory matrix


shadowMatrixArray

public swarm.collections.ArrayImpl shadowMatrixArray
the array of shadow matrixes built one for each layer, if layers are > 1 and sensitive==true


shadowMatrix

public float[][] shadowMatrix
the shadow memory matrix


numberOfRows

public int numberOfRows
the numberOfRows of matrix


numberOfCols

public int numberOfCols
the numberOfCols of matrix


printMatrixes

public boolean printMatrixes
print matrix option

Constructor Detail

MemoryMatrix

public MemoryMatrix(swarm.defobj.Zone aZone,
                    int n,
                    boolean s,
                    int tln,
                    int nor,
                    int noc,
                    boolean pm)
the constructor for MemoryMatrix

Method Detail

setValue

public void setValue(int layer,
                     int row,
                     int col,
                     float value)
setting a value (float)


setValue

public void setValue(int layer,
                     int row,
                     int col,
                     double value)
setting a value (double)


getValue

public float getValue(int layer,
                      int row,
                      int col)
getting a value


getEmpty

public boolean getEmpty(int layer,
                        int row,
                        int col)
checking if a position in a matrix is empty


setEmpty

public void setEmpty(int layer,
                     int row,
                     int col)
setting a position in a matrix as empty


print

public void print()
printing the matrix on the current terminal


getNumberOfRows

public int getNumberOfRows()
returning the number of rows


getNumberOfCols

public int getNumberOfCols()
returning the number of cols


getMemoryMatrixNumber

public int getMemoryMatrixNumber()
returning the number of the matrix