Class AgentSQ1Dunstackable<T extends AgentGrid1D>

  • Type Parameters:
    T - the extended Grid2unstackable class that the agents will live in Created by rafael on 11/18/16.
    All Implemented Interfaces:

    public class AgentSQ1Dunstackable<T extends AgentGrid1D>
    extends Agent1DBase<T>
    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 Detail

      • AgentSQ1Dunstackable

        public AgentSQ1Dunstackable()
    • Method Detail

      • 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:
        Xsq in class Agent1DBase<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:
        Age in class AgentBase<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.