edu.udo.cs.ie.cowbots.internalActions.scout
Class calculateDistanceToDestination

Package class diagram package calculateDistanceToDestination
java.lang.Object
  extended by DefaultInternalAction
      extended by edu.udo.cs.ie.cowbots.internalActions.scout.calculateDistanceToDestination

public class calculateDistanceToDestination
extends DefaultInternalAction


Field Summary
(package private)  int delta
           
 
Constructor Summary
calculateDistanceToDestination()
           
 
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
 

Field Detail

delta

int delta
Constructor Detail

calculateDistanceToDestination

public calculateDistanceToDestination()
Method Detail

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 1
myY - Y-coordinate of Point 1
destX - X-coordinate of Point 2
destY - Y-coordinate of Point 2
Returns:
result-byte, value = 1, if the 2 Points are nearby, value = 0 else