jason.environment.grid
Class Location

Package class diagram package Location
java.lang.Object
  extended by 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
 int x
           
 int y
           
 
Constructor Summary
Location(int x, int y)
           
 
Method Summary
 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 Detail

x

public int x

y

public int y
Constructor Detail

Location

public Location(int x,
                int y)
Method Detail

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

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