Class Location

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

public final class Location extends Object implements Serializable
See Also:
  • 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 Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object