edu.udo.cs.ie.cowbots.internalActions.scout
Class getOpeningPosition
java.lang.Object
DefaultInternalAction
edu.udo.cs.ie.cowbots.internalActions.scout.getOpeningPosition
public class getOpeningPosition
- extends DefaultInternalAction
Class for calculating the position to handle the switch
while passing a fence
Method Summary |
private java.awt.Point |
calculatetarget(int f,
int x,
int y,
int w,
int u,
java.lang.String direction)
Utility function for calculating the target position |
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 |
getOpeningPosition
public getOpeningPosition()
execute
public java.lang.Object execute(TransitionSystem ts,
Unifier un,
Term[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
calculatetarget
private java.awt.Point calculatetarget(int f,
int x,
int y,
int w,
int u,
java.lang.String direction)
- Utility function for calculating the target position
- Parameters:
f
- int-flag, value = 1, if the position for a "doorcloser" needs to be found,
value = 0 for a dooropenerx
- X-coordinate of the WP needed to calculate the Positiony
- Y-coordinate of the WP needed to calculate the Positionw
- X-coordinate of the switchu
- Y-coordinate of the switchdirection
- the direction of the fence (vertical or horizontal)
- Returns:
- Point encoding the coordinates