RoboJDETM v2.0

com.ridgesoft.robotics
Interface Behavior

All Known Subinterfaces:
Behavior2
All Known Implementing Classes:
AbstractBehavior2, AvoidBehavior, GoToBehavior, StopBehavior

public interface Behavior

Interface implemented by behaviors intended to be used in conjunction with a BehaviorArbiter. See the BehaviorArbiter class for more information.

See Also:
BehaviorArbiter, Behavior2, BehaviorEvent, BehaviorListener, com.ridgesoft.robotics.behaviors

Method Summary
 boolean poll()
          This method is invoked at regular intervals to determine if the behavior desires to control the robot.
 void setActive(boolean isActive)
          Activates or deactivates the behavior.
 

Method Detail

poll

boolean poll()
This method is invoked at regular intervals to determine if the behavior desires to control the robot.

If the behavior is active, it may use this method as a means to update its control of the robot. However, this is not required. The behavior may also use a separate thread or a timer to accomplish its control functions.

Returns:
true if the behavior wants control of the robot, otherwise false

setActive

void setActive(boolean isActive)
Activates or deactivates the behavior.

When a behavior is active, it must take control of the robot. When a behavior is inactive, it must not attempt to control the robot.

Parameters:
isActive - true if the behavior is being activated, otherwise false

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com