Class Agent3DBase<T extends AgentGrid3D>

    • Field Summary

      • Fields inherited from class HAL.GridsAndAgents.AgentBase

        G
    • Constructor Summary

      Constructors 
      Constructor Description
      Agent3DBase()  
    • Method Summary

      Modifier and Type Method Description
      double DispX​(double x)
      gets the X displacement from this agent to a given x position
      double DispY​(double y)
      gets the Y displacement from this agent to a given y position
      double DispZ​(double z)
      gets the Z displacement from this agent to a given z position
      double Dist​(double x, double y, double z)
      gets the distance from this agent to another position
      double DistSquared​(double x, double y, double z)
      gets the distance squared from this agent to another position, more efficient than Dist
      int MapEmptyHood​(int[] hood)
      These functions are similar to the the MapHood function, but they will only include valid empty or occupied indices, and skip the others.
      int MapHood​(int[] hood)
      This function takes a neighborhood (As generated by the neighborhood Util functions, or using GenHood2D/GenHood3D), translates the neighborhood coordinates to be centered around the agent, and computes the set of indices that the translated coordinates map to.
      int MapHood​(int[] hood, IndexCoords3DBool Eval)
      This function takes a neighborhood and another mapping function as argument, the mapping function should return a boolean that specifies whether coordinates map to a valid location.
      int MapI​(Grid3D other)
      returns the index of the center of the square in otherGrid that the coordinate maps to.
      int MapOccupiedHood​(int[] hood)
      These functions are similar to the the MapHood function, but they will only include valid empty or occupied indices, and skip the others.
      double MapXpt​(Grid3D other)
      returns the provided coordinate scaled to the dimensions of the otherGrid.
      int MapXsq​(Grid3D other)
      returns the index of the center of the square in otherGrid that the coordinate maps to.
      double MapYpt​(Grid3D other)
      returns the provided coordinate scaled to the dimensions of the otherGrid.
      int MapYsq​(Grid3D other)
      returns the index of the center of the square in otherGrid that the coordinate maps to.
      double MapZpt​(Grid3D other)
      returns the provided coordinate scaled to the dimensions of the otherGrid.
      int MapZsq​(Grid3D other)
      returns the index of the center of the square in otherGrid that the coordinate maps to.
      abstract double Xpt()
      returns the X coordinate of the agent.
      abstract int Xsq()
      returns the X index of the square that the agent is currently on.
      abstract double Ypt()
      returns the Y coordinate of the agent.
      abstract int Ysq()
      returns the Y index of the square that the agent is currently on.
      abstract double Zpt()
      returns the Z coordinate of the agent.
      abstract int Zsq()
      returns the Z index of the square that the agent is currently on.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Agent3DBase

        public Agent3DBase()
    • Method Detail

      • Xsq

        public abstract int Xsq()
        returns the X index of the square that the agent is currently on.
      • Ysq

        public abstract int Ysq()
        returns the Y index of the square that the agent is currently on.
      • Zsq

        public abstract int Zsq()
        returns the Z index of the square that the agent is currently on.
      • Xpt

        public abstract double Xpt()
        returns the X coordinate of the agent. If the Agent is on-lattice, these functions will return the coordinates of the middle of the square that the agent is on.
      • Ypt

        public abstract double Ypt()
        returns the Y coordinate of the agent. If the Agent is on-lattice, these functions will return the coordinates of the middle of the square that the agent is on.
      • Zpt

        public abstract double Zpt()
        returns the Z coordinate of the agent. If the Agent is on-lattice, these functions will return the coordinates of the middle of the square that the agent is on.
      • MapXsq

        public int MapXsq​(Grid3D other)
        returns the index of the center of the square in otherGrid that the coordinate maps to.
      • MapYsq

        public int MapYsq​(Grid3D other)
        returns the index of the center of the square in otherGrid that the coordinate maps to.
      • MapZsq

        public int MapZsq​(Grid3D other)
        returns the index of the center of the square in otherGrid that the coordinate maps to.
      • MapI

        public int MapI​(Grid3D other)
        returns the index of the center of the square in otherGrid that the coordinate maps to.
      • MapXpt

        public double MapXpt​(Grid3D other)
        returns the provided coordinate scaled to the dimensions of the otherGrid.
      • MapYpt

        public double MapYpt​(Grid3D other)
        returns the provided coordinate scaled to the dimensions of the otherGrid.
      • MapZpt

        public double MapZpt​(Grid3D other)
        returns the provided coordinate scaled to the dimensions of the otherGrid.
      • MapHood

        public int MapHood​(int[] hood)
        This function takes a neighborhood (As generated by the neighborhood Util functions, or using GenHood2D/GenHood3D), translates the neighborhood coordinates to be centered around the agent, and computes the set of indices that the translated coordinates map to. The function returns the number of valid locations it set, which if wraparound is disabled may be less than the full set of coordinate pairs. this means that the passed in ret list will not be completely filled with valid entries. See the CellStep function in the Complete Model example for more information.
      • MapHood

        public int MapHood​(int[] hood,
                           IndexCoords3DBool Eval)
        This function takes a neighborhood and another mapping function as argument, the mapping function should return a boolean that specifies whether coordinates map to a valid location. the function will only include valid indices, and skip the others.
      • MapEmptyHood

        public int MapEmptyHood​(int[] hood)
        These functions are similar to the the MapHood function, but they will only include valid empty or occupied indices, and skip the others.
      • MapOccupiedHood

        public int MapOccupiedHood​(int[] hood)
        These functions are similar to the the MapHood function, but they will only include valid empty or occupied indices, and skip the others.
      • DispX

        public double DispX​(double x)
        gets the X displacement from this agent to a given x position
      • DispY

        public double DispY​(double y)
        gets the Y displacement from this agent to a given y position
      • DispZ

        public double DispZ​(double z)
        gets the Z displacement from this agent to a given z position
      • Dist

        public double Dist​(double x,
                           double y,
                           double z)
        gets the distance from this agent to another position
      • DistSquared

        public double DistSquared​(double x,
                                  double y,
                                  double z)
        gets the distance squared from this agent to another position, more efficient than Dist