Class JointField

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map

    public class JointField
    extends java.util.HashMap
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double[][] desire
      desire
      FieldModel field  
      double maxDesire
      maxDesire maximum value in desire
      double minDesire
      minDesire minimum value in desire > 0
    • Constructor Summary

      Constructors 
      Constructor Description
      JointField​(int h, int w, int range, Evaluator ev)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Creature creature)  
      void add​(Food f)  
      void add​(Obstacle o)  
      void add​(WorldObject wo)  
      protected void addModel​(double factor, CreatureModel model)  
      void calcDesire()  
      void eaten​(Creature c)  
      Location getBestLocation()  
      boolean getNearerLocation​(Location loc)  
      void update​(WorldObject[] w, Creature myself)  
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Field Detail

      • desire

        public final double[][] desire
        desire
      • maxDesire

        public double maxDesire
        maxDesire maximum value in desire
      • minDesire

        public double minDesire
        minDesire minimum value in desire > 0
    • Constructor Detail

      • JointField

        public JointField​(int h,
                          int w,
                          int range,
                          Evaluator ev)
        Parameters:
        h -
        w -
        range -
        ev -
    • Method Detail

      • add

        public void add​(Creature creature)
        Parameters:
        creature -
      • add

        public void add​(Food f)
        Parameters:
        f -
      • add

        public void add​(Obstacle o)
        Parameters:
        o -
      • add

        public void add​(WorldObject wo)
        Parameters:
        wo -
      • update

        public void update​(WorldObject[] w,
                           Creature myself)
        Parameters:
        w - world objects
        myself -
      • eaten

        public void eaten​(Creature c)
        Parameters:
        c -
      • getBestLocation

        public Location getBestLocation()
        Returns:
        the best location
      • getNearerLocation

        public boolean getNearerLocation​(Location loc)
        Parameters:
        loc -
        Returns:
        true if location changed
      • calcDesire

        public void calcDesire()
      • addModel

        protected void addModel​(double factor,
                                CreatureModel model)
        Parameters:
        factor -
        model -