edu.udo.cs.ie.cowbots.internalActions.scout
Class checkHelpersNearCWP
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.checkHelpersNearCWP
public class checkHelpersNearCWP
- extends DefaultInternalAction
Class for calculating the distance of relevant Helpers to a Closewaypoint.
Called by Leaders exclusively to determine whether all his Groupmembers
have passed a fence or not.
Method Summary |
private int |
calculateDistance(int myX,
int myY,
int destX,
int destY)
|
private int |
checkHelpers(int x,
int y,
java.lang.String name)
Utility function for calculating whether all relevant Helpers are near
the Closewaypoint |
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 |
cowbot
ICowbot cowbot
checkHelpersNearCWP
public checkHelpersNearCWP()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkHelpers
private int checkHelpers(int x,
int y,
java.lang.String name)
- Utility function for calculating whether all relevant Helpers are near
the Closewaypoint
- Parameters:
x
- X-coordinate of the Waypointy
- Y-coordinate of the Waypointname
- the name of the helper responsible of keeping the door open,
the leader has to make sure he doesnt include that helper in his calculation
- Returns:
- result-int, value = 1, if all relevant helpers are nearby, value = 0 else
calculateDistance
private int calculateDistance(int myX,
int myY,
int destX,
int destY)