Class Regions.MultidimensionalDistance

  • All Implemented Interfaces:
    java.lang.Comparable<Regions.MultidimensionalDistance>
    Enclosing class:
    Regions

    public static class Regions.MultidimensionalDistance
    extends java.lang.Object
    implements java.lang.Comparable<Regions.MultidimensionalDistance>
    A distance value that uses a tuple of distance components. dist is the primary distance value. plus is a bonus value for regions with the same distance but some additional bonus. realDist is a tertiary value, usually the number of regions on the shortest path. pot is an additional potential that can be used to speed up the search ("goal-directed search").
    Author:
    stm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int dist  
      protected int plus  
      protected int pot  
      protected int realDist  
    • Constructor Summary

      Constructors 
      Constructor Description
      MultidimensionalDistance​(int d, int p, int r, int pot)  
    • Field Detail

      • dist

        protected int dist
      • plus

        protected int plus
      • realDist

        protected int realDist
      • pot

        protected int pot
    • Constructor Detail

      • MultidimensionalDistance

        public MultidimensionalDistance​(int d,
                                        int p,
                                        int r,
                                        int pot)
    • Method Detail

      • getDistance

        public int getDistance()
      • compareTo

        public int compareTo​(int newdist,
                             int newplus,
                             int newrealDist,
                             int newpot)
        Compares the distance (plus potential) first, the number of "non-plussed" regions on the path second, and the real distance third.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • setInfinity

        public void setInfinity()
        Sets this distance to infinity.
      • isInfinity

        public boolean isInfinity()
        Returns true if this distance is infinite.