edu.udo.cs.ie.cowbots.internalActions.scout
Class calculateDistanceToDestination
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.calculateDistanceToDestination
public class calculateDistanceToDestination
- extends DefaultInternalAction
Field Summary |
(package private) int |
delta
|
Method Summary |
private byte |
calculateDistance(int myX,
int myY,
int destX,
int destY)
Utility function for calculating the distance between 2 points
and comparing it to a threshold delta |
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delta
int delta
calculateDistanceToDestination
public calculateDistanceToDestination()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
calculateDistance
private byte calculateDistance(int myX,
int myY,
int destX,
int destY)
- Utility function for calculating the distance between 2 points
and comparing it to a threshold delta
- Parameters:
myX
- X-coordinate of Point 1myY
- Y-coordinate of Point 1destX
- X-coordinate of Point 2destY
- Y-coordinate of Point 2
- Returns:
- result-byte, value = 1, if the 2 Points are nearby, value = 0 else