Package HAL.GridsAndAgents
Class AgentSQ1Dunstackable<T extends AgentGrid1D>
- java.lang.Object
 - 
- HAL.GridsAndAgents.AgentBase<T>
 - 
- HAL.GridsAndAgents.AgentBaseSpatial<T>
 - 
- HAL.GridsAndAgents.Agent1DBase<T>
 - 
- HAL.GridsAndAgents.AgentSQ1Dunstackable<T>
 
 
 
 
 
- 
- Type Parameters:
 T- the extended Grid2unstackable class that the agents will live in Created by rafael on 11/18/16.
- All Implemented Interfaces:
 java.io.Serializable
public class AgentSQ1Dunstackable<T extends AgentGrid1D> extends Agent1DBase<T> implements java.io.Serializable
extend the AgentSQ2Dunstackable class if you want agents that exist on a 2D discrete lattice without the possibility of stacking multiple agents on the same typeGrid square- See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description AgentSQ1Dunstackable() 
- 
Method Summary
Modifier and Type Method Description intAge()Gets the index of the square that the agent occupiesvoidDispose()Deletes the agentvoidGetAllOnSquare(java.util.ArrayList<AgentBaseSpatial> putHere)intIsq()returns the index of the square that the agent is currently onvoidMoveSafeSQ(int newX)Moves the agent to the specified square, will apply wraparound if it is enabledvoidMoveSQ(int x)Moves the agent to the square with the specified indexvoidSwapPosition(AgentSQ1Dunstackable<T> other)swaps the positions of two agents.doubleXpt()Gets the xDim coordinate agentintXsq()Gets the xDim coordinate of the square that the agent occupies- 
Methods inherited from class HAL.GridsAndAgents.Agent1DBase
DispX, Dist, DistSquared, MapEmptyHood, MapHood, MapHood, MapI, MapOccupiedHood, MapXpt, MapXsq 
- 
Methods inherited from class HAL.GridsAndAgents.AgentBase
BirthTick, IsAlive, SetBirthTick 
 - 
 
 - 
 
- 
- 
Method Detail
- 
MoveSQ
public void MoveSQ(int x)
Moves the agent to the square with the specified index- Specified by:
 MoveSQin classAgentBaseSpatial<T extends AgentGrid1D>
 
- 
MoveSafeSQ
public void MoveSafeSQ(int newX)
Moves the agent to the specified square, will apply wraparound if it is enabled 
- 
Xsq
public int Xsq()
Gets the xDim coordinate of the square that the agent occupies- Specified by:
 Xsqin classAgent1DBase<T extends AgentGrid1D>
 
- 
Xpt
public double Xpt()
Gets the xDim coordinate agent- Specified by:
 Xptin classAgent1DBase<T extends AgentGrid1D>
 
- 
Dispose
public void Dispose()
Deletes the agent- Specified by:
 Disposein classAgentBase<T extends AgentGrid1D>
 
- 
GetAllOnSquare
public void GetAllOnSquare(java.util.ArrayList<AgentBaseSpatial> putHere)
 
- 
Age
public int Age()
Gets the index of the square that the agent occupies- Specified by:
 Agein classAgentBase<T extends AgentGrid1D>
 
- 
Isq
public int Isq()
Description copied from class:AgentBaseSpatialreturns the index of the square that the agent is currently on- Overrides:
 Isqin classAgentBaseSpatial<T extends AgentGrid1D>
 
- 
SwapPosition
public void SwapPosition(AgentSQ1Dunstackable<T> other)
swaps the positions of two agents. useful for the AgentSQunstackable classes, which don't allow stacking of agents, making this maneuver otherwise impossible. 
 - 
 
 -