Class Location

java.lang.Object
jason.environment.grid.Location
All Implemented Interfaces:
java.io.Serializable

public final class Location
extends java.lang.Object
implements java.io.Serializable
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type Field Description
    int x  
    int y  
  • Constructor Summary

    Constructors
    Constructor Description
    Location​(int x, int y)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object clone()  
    int distance​(Location l)
    calculates the Manhattan distance between two points
    int distanceChebyshev​(Location l)
    returns the chessboard king (or Chebyshev) distance between two locations : max( |this.x - l.x| , |this.y - l.y|)
    double distanceEuclidean​(Location l)
    calculates the Euclidean distance between two points
    int distanceManhattan​(Location l)
    calculates the Manhattan distance between two points
    boolean equals​(java.lang.Object obj)  
    int hashCode()  
    boolean isInArea​(Area a)  
    boolean isInArea​(Location tl, Location br)  
    boolean isNeigbour​(Location l)  
    int maxBorder​(Location l)
    Deprecated.
    renamed to distanceChessboard
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      public int x
    • y

      public int y
  • Constructor Details

    • Location

      public Location​(int x, int y)
  • Method Details

    • distanceManhattan

      public int distanceManhattan​(Location l)
      calculates the Manhattan distance between two points
    • distance

      public int distance​(Location l)
      calculates the Manhattan distance between two points
    • distanceEuclidean

      public double distanceEuclidean​(Location l)
      calculates the Euclidean distance between two points
    • distanceChebyshev

      public int distanceChebyshev​(Location l)
      returns the chessboard king (or Chebyshev) distance between two locations : max( |this.x - l.x| , |this.y - l.y|)
    • maxBorder

      @Deprecated public int maxBorder​(Location l)
      Deprecated.
      renamed to distanceChessboard
    • isInArea

      public boolean isInArea​(Location tl, Location br)
    • isInArea

      public boolean isInArea​(Area a)
    • isNeigbour

      public boolean isNeigbour​(Location l)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • clone

      public java.lang.Object clone()
      Overrides:
      clone in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object