Class StandMelderBehavior

java.lang.Object
  extended by StandMelderBehavior
All Implemented Interfaces:
Behavior

public class StandMelderBehavior
extends java.lang.Object
implements Behavior

Lässt den Roboter beim Stand (z.B. Fahrt gegen eine Wand) zurückstoßen und beim Hängen in einer Ecke eine Flanke schießen. Das Behaviour läuft mit höchster Priorität.

Author:
Franz Steinmetz

Field Summary
static boolean inDerEcke
           
static boolean takeControl
           
 
Constructor Summary
StandMelderBehavior()
           
 
Method Summary
 void action()
          The code in action() represents the actual action of the robot when this behavior becomes active.
 void suppress()
          The code in suppress() should stop the current behavior.
 boolean takeControl()
          Übernimmt die Kontrolle, wenn der zugehörige Thread den Stand des Roboters oder das Hängen in der Ecke gemeldet hat
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inDerEcke

public static boolean inDerEcke

takeControl

public static boolean takeControl
Constructor Detail

StandMelderBehavior

public StandMelderBehavior()
Method Detail

action

public void action()
Description copied from interface: Behavior
The code in action() represents the actual action of the robot when this behavior becomes active. It can be as complex as navigating around a room, or as simple as playing a tune.
The contract for implementing this method is:
Any action can be started in this method. This method should not start a never ending loop. This method can return on its own, or when the suppress() method is called; but it must return eventually. The action can run in a seperate thread if the designer wishes it, and can therefore continue running after this method call returns.

Specified by:
action in interface Behavior

suppress

public void suppress()
Description copied from interface: Behavior
The code in suppress() should stop the current behavior. This can include stopping motors, or even calling methods to update internal data (such as navigational coordinates).
The contract for implementing this method is:
This method will stop the action running in this Behavior class. This method will not return until that action has been stopped. It is acceptable for a delay to occur while the action() method finishes up.

Specified by:
suppress in interface Behavior

takeControl

public boolean takeControl()
Übernimmt die Kontrolle, wenn der zugehörige Thread den Stand des Roboters oder das Hängen in der Ecke gemeldet hat

Specified by:
takeControl in interface Behavior
Returns:
boolean Indicates if this Behavior should seize control.