|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.getScoutSwitchFinder
public class getScoutSwitchFinder
Class to calculate the Helper, who should be ordered to serach for a switch if the switch for the relevant fence isn't found yet
Field Summary | |
---|---|
(package private) ICowbot |
cowbot
|
(package private) GridMap |
map
|
(package private) java.awt.Point |
target1
|
(package private) java.awt.Point |
target2
|
Constructor Summary | |
---|---|
getScoutSwitchFinder()
|
Method Summary | |
---|---|
private int |
calcDistance(ELPLiteral e,
int x,
int y)
Utility function for calculating the distance between Agent and point to go |
private java.lang.String[] |
calcfinders(java.awt.Point p1,
java.awt.Point p2)
Utility function to get the two helpers required to search for the switch |
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
|
private java.lang.String |
getHelper(int x,
int y,
java.lang.String name)
Utility function to get the nearest Helper to the point specified |
private void |
settargets(int xcoord,
int ycoord,
int wpxcoord,
int wpycoord,
java.lang.String dir)
Utility function for setting the targets the searching helpers should go to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
ICowbot cowbot
java.awt.Point target1
java.awt.Point target2
GridMap map
Constructor Detail |
---|
public getScoutSwitchFinder()
Method Detail |
---|
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.Exception
java.lang.Exception
private void settargets(int xcoord, int ycoord, int wpxcoord, int wpycoord, java.lang.String dir)
xcoord
- X-coordinate of the fencecell, which belongs to the fenceycoord
- Y-coordinate of the fencecell, which belongs to the fencewpxcoord
- X-coordinate waypoint required to calculate the coordinates (usually the fenceopenwp)wpycoord
- Y-coordinate waypoint required to calculate the coordinates (usually the fenceopenwp)dir
- direction of the fence (vertical or horizontal)private java.lang.String[] calcfinders(java.awt.Point p1, java.awt.Point p2)
p1
- first destination, where to lookp2
- second destination, where to look
private int calcDistance(ELPLiteral e, int x, int y)
e
- the ELPLiteral encoding the agents position.x
- X-coordinate of the pointy
- Y-coordinate of the point
private java.lang.String getHelper(int x, int y, java.lang.String name)
x
- X-coordinate of the pointCPy
- Y-coordinate of the pointname
- the name to be excluded in the search (to avoid that the same agent is chosen twice)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |