edu.udo.cs.ie.cowbots.internalActions.scout
Class getOpeningPosition

Package class diagram package getOpeningPosition
java.lang.Object
  extended by DefaultInternalAction
      extended by 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


Constructor Summary
getOpeningPosition()
           
 
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
 

Constructor Detail

getOpeningPosition

public getOpeningPosition()
Method Detail

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 dooropener
x - X-coordinate of the WP needed to calculate the Position
y - Y-coordinate of the WP needed to calculate the Position
w - X-coordinate of the switch
u - Y-coordinate of the switch
direction - the direction of the fence (vertical or horizontal)
Returns:
Point encoding the coordinates