Class MicroPreyAgent


  • public class MicroPreyAgent
    extends java.lang.Object
    Simple agent participating in hunter prey.
    • Field Detail

      • env

        protected Grid2D env
        The environment.
      • myself

        protected ISpaceObject myself
        The creature's self representation.
      • lastdir

        protected java.lang.String lastdir
        The last move direction (if any).
      • food

        protected ISpaceObject food
        The nearest food (if any).
      • listener

        protected IResultListener listener
        The result listener starting the next action.
    • Constructor Detail

      • MicroPreyAgent

        public MicroPreyAgent()
    • Method Detail

      • executeBody

        public IFuture<java.lang.Void> executeBody()
        Execute a step.
      • act

        protected void act()
        Choose and perform an action.
      • getNearestFood

        public ISpaceObject getNearestFood()
        Get the known food.
      • setNearestFood

        public void setNearestFood​(ISpaceObject food)
        Set the known food.