edu.udo.cs.ie.cowbots.internalActions.scout
Class distanceToCP
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.distanceToCP
public class distanceToCP
- extends DefaultInternalAction
Class for calculating the distance of the Agent to the checkpoint
Method Summary |
private int |
calculateDistance(int myX,
int myY,
int destX,
int destY)
Utility function for calculating the distance between Agent and checkpoint |
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 |
distanceToCP
public distanceToCP()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
calculateDistance
private int calculateDistance(int myX,
int myY,
int destX,
int destY)
- Utility function for calculating the distance between Agent and checkpoint
- Parameters:
myX
- X-coordinate of the AgentmyY
- Y-coordinate of the AgentdestX
- X-coordinate of the CPdestY
- Y-coordinate of the CP
- Returns:
- the distance