Package jason.environment.grid
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
-
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 pointsint
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 pointsint
distanceManhattan(Location l)
calculates the Manhattan distance between two pointsboolean
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 distanceChessboardjava.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
calculates the Manhattan distance between two points -
distance
calculates the Manhattan distance between two points -
distanceEuclidean
calculates the Euclidean distance between two points -
distanceChebyshev
returns the chessboard king (or Chebyshev) distance between two locations : max( |this.x - l.x| , |this.y - l.y|) -
maxBorder
Deprecated.renamed to distanceChessboard -
isInArea
-
isInArea
-
isNeigbour
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
clone
public java.lang.Object clone()- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-