Package HAL.GridsAndAgents
Class AgentPT3D<T extends AgentGrid3D>
- java.lang.Object
-
- HAL.GridsAndAgents.AgentBase<T>
-
- HAL.GridsAndAgents.AgentBaseSpatial<T>
-
- HAL.GridsAndAgents.Agent3DBase<T>
-
- HAL.GridsAndAgents.AgentPT3D<T>
-
- Type Parameters:
T
- the extended AgentGrid3D class that the agents will live in Created by rafael on 11/18/16.
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
SphericalAgent3D
public class AgentPT3D<T extends AgentGrid3D> extends Agent3DBase<T> implements java.io.Serializable
extend the AgentPT3D class if you want agents that exist on a 3D continuous lattice with the possibility of stacking multiple agents on the same typeGrid square- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AgentPT3D()
-
Method Summary
Modifier and Type Method Description int
Age()
returns the age of the agent, in ticks.void
Dispose()
removes the agent from the gridvoid
MovePT(double newX, double newY, double newZ)
Moves the agent to the specified coordinatesvoid
MoveSafePT(double newX, double newY, double newZ)
Similar to the move functions, only it will automatically either apply wraparound, or prevent moving along a partiular axis if movement would cause the agent to go out of bounds.void
MoveSafePT(double newX, double newY, double newZ, Point3DBool IsValidMove)
void
MoveSafeSQ(int newX, int newY, int newZ)
Similar to the move functions, only it will automatically either apply wraparound, or prevent moving along a partiular axis if movement would cause the agent to go out of bounds.void
MoveSafeSQ(int newX, int newY, int newZ, Coords3DBool IsValidMove)
void
MoveSQ(int iNext)
Moves the agent to the specified coordinatesvoid
MoveSQ(int newX, int newY, int newZ)
Moves the agent to the specified coordinatesdouble
Xpt()
gets the xDim coordinate of the agentint
Xsq()
gets the xDim coordinate of the square that the agent occupiesdouble
Ypt()
gets the yDim coordinate of the agentint
Ysq()
gets the yDim coordinate of the square that the agent occupiesdouble
Zpt()
gets the z coordinate of the agentint
Zsq()
gets the z coordinate of the square that the agent occupies-
Methods inherited from class HAL.GridsAndAgents.Agent3DBase
DispX, DispY, DispZ, Dist, DistSquared, MapEmptyHood, MapHood, MapHood, MapI, MapOccupiedHood, MapXpt, MapXsq, MapYpt, MapYsq, MapZpt, MapZsq
-
Methods inherited from class HAL.GridsAndAgents.AgentBaseSpatial
Isq
-
Methods inherited from class HAL.GridsAndAgents.AgentBase
BirthTick, IsAlive, SetBirthTick
-
-
-
-
Method Detail
-
MoveSQ
public void MoveSQ(int iNext)
Moves the agent to the specified coordinates- Specified by:
MoveSQ
in classAgentBaseSpatial<T extends AgentGrid3D>
-
MoveSQ
public void MoveSQ(int newX, int newY, int newZ)
Moves the agent to the specified coordinates
-
MovePT
public void MovePT(double newX, double newY, double newZ)
Moves the agent to the specified coordinates
-
MoveSafeSQ
public void MoveSafeSQ(int newX, int newY, int newZ)
Similar to the move functions, only it will automatically either apply wraparound, or prevent moving along a partiular axis if movement would cause the agent to go out of bounds.
-
MoveSafeSQ
public void MoveSafeSQ(int newX, int newY, int newZ, Coords3DBool IsValidMove)
-
MoveSafePT
public void MoveSafePT(double newX, double newY, double newZ)
Similar to the move functions, only it will automatically either apply wraparound, or prevent moving along a partiular axis if movement would cause the agent to go out of bounds.
-
MoveSafePT
public void MoveSafePT(double newX, double newY, double newZ, Point3DBool IsValidMove)
-
Xpt
public double Xpt()
gets the xDim coordinate of the agent- Specified by:
Xpt
in classAgent3DBase<T extends AgentGrid3D>
-
Ypt
public double Ypt()
gets the yDim coordinate of the agent- Specified by:
Ypt
in classAgent3DBase<T extends AgentGrid3D>
-
Zpt
public double Zpt()
gets the z coordinate of the agent- Specified by:
Zpt
in classAgent3DBase<T extends AgentGrid3D>
-
Xsq
public int Xsq()
gets the xDim coordinate of the square that the agent occupies- Specified by:
Xsq
in classAgent3DBase<T extends AgentGrid3D>
-
Ysq
public int Ysq()
gets the yDim coordinate of the square that the agent occupies- Specified by:
Ysq
in classAgent3DBase<T extends AgentGrid3D>
-
Zsq
public int Zsq()
gets the z coordinate of the square that the agent occupies- Specified by:
Zsq
in classAgent3DBase<T extends AgentGrid3D>
-
Dispose
public void Dispose()
removes the agent from the grid- Specified by:
Dispose
in classAgentBase<T extends AgentGrid3D>
-
Age
public int Age()
returns the age of the agent, in ticks. Be sure to use IncTick on the AgentGrid appropriately for this function to work.- Specified by:
Age
in classAgentBase<T extends AgentGrid3D>
-
-