Class AgentBase<T>

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Agent0D, AgentBaseSpatial

    public abstract class AgentBase<T>
    extends java.lang.Object
    implements java.io.Serializable
    AgentBase functions are shared amongst all agent types
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      T G
      returns the grid that the agent belongs to (this is a permanent agent property, not a function)
    • Constructor Summary

      Constructors 
      Constructor Description
      AgentBase()  
    • Method Summary

      Modifier and Type Method Description
      abstract int Age()
      returns the age of the agent, in ticks.
      int BirthTick()
      returns the tick on which the agent was born
      abstract void Dispose()
      removes the agent from the grid
      boolean IsAlive()
      Returns whether the agent is alive or has been disposed
      void SetBirthTick​(int tick)
      sets the agent's birthtick value, which is used for the Age calculation
      • Methods inherited from class java.lang.Object

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

      • G

        public final T G
        returns the grid that the agent belongs to (this is a permanent agent property, not a function)
    • Constructor Detail

      • AgentBase

        public AgentBase()
    • Method Detail

      • IsAlive

        public boolean IsAlive()
        Returns whether the agent is alive or has been disposed
      • BirthTick

        public int BirthTick()
        returns the tick on which the agent was born
      • SetBirthTick

        public void SetBirthTick​(int tick)
        sets the agent's birthtick value, which is used for the Age calculation
      • Age

        public abstract int Age()
        returns the age of the agent, in ticks. Be sure to use IncTick on the AgentGrid appropriately for this function to work.
      • Dispose

        public abstract void Dispose()
        removes the agent from the grid