edu.udo.cs.ie.cowbots.internalActions.scout
Class getNearestHelper
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.getNearestHelper
public class getNearestHelper
- extends DefaultInternalAction
Class for choosing the nearest Helper to a certain Point
Method Summary |
private int |
calcDistance(ELPLiteral e,
int x,
int y)
Utility function for calculating the distance between Agent and checkpoint |
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
|
private java.lang.String |
getHelper(int x,
int y,
java.lang.String fenceopenername)
Utility function for calculating the distance between 2 points
and comparing it to a threshold delta |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cowbot
ICowbot cowbot
getNearestHelper
public getNearestHelper()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
getHelper
private java.lang.String getHelper(int x,
int y,
java.lang.String fenceopenername)
- Utility function for calculating the distance between 2 points
and comparing it to a threshold delta
- Parameters:
x
- X-coordinate of the Pointy
- Y-coordinate of the Point
- Returns:
- the name of the nearest helper
calcDistance
private int calcDistance(ELPLiteral e,
int x,
int y)
- Utility function for calculating the distance between Agent and checkpoint
- Parameters:
e
- the ELPLiteral encoding the agents position.x
- X-coordinate of the CPy
- Y-coordinate of the CP
- Returns:
- the distance