|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdlife.robot.Controller
dlife.robot.controllers.subsumption.SubsumptionController
public abstract class SubsumptionController
Controller based upon the Subsumption Architecture.
To create a subsumption controller:
startUp method:
super.startUp
step method to send commands to the robot
based on the outputs of the behaviors. NOTE: Behaviors should not send
commands directly to the robot. Instead, they generate their outputs which
are ultimately interpreted by the step method which sends the commands to the
robot.
The SubsumptionController maintains a key,value map for the output signals of each Behavior. The Behaviors specify their input signals by using keys that can be found in the map. Behaviors also specify the key to be used to store their output signal into the map.
| Nested Class Summary | |
|---|---|
static class |
SubsumptionController.Signal
Representation of a signal that is passed between behaviors. |
| Field Summary | |
|---|---|
static SubsumptionController.Signal |
NONE
The value associated with keys that have no current value. |
| Constructor Summary | |
|---|---|
SubsumptionController()
|
|
| Method Summary | |
|---|---|
void |
addBehavior(Behavior b)
Add the specified behavior to this SubsumptionController. |
SubsumptionController.Signal |
getValue(String key)
Get a signal from the behavior output map. |
void |
setValue(String key,
SubsumptionController.Signal signal)
Set the signal for a key in behavior output map. |
void |
shutDown()
Shutdown this SubsumptionController. |
void |
startUp(Robot robot)
Resets all of the Behavior objects. |
| Methods inherited from class dlife.robot.Controller |
|---|
step |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SubsumptionController.Signal NONE
| Constructor Detail |
|---|
public SubsumptionController()
| Method Detail |
|---|
public final SubsumptionController.Signal getValue(String key)
key - the key for the signal to be obtained.
UnknownKeyException - if the specified key does not exist in the
map.
public final void setValue(String key,
SubsumptionController.Signal signal)
key - the key (may be null for unused values or behaviors that have
no output).signal - the signal associated with the key.public void startUp(Robot robot)
startUp in class Controllerrobot - the Robot that this Controller will be controlling.public void shutDown()
shutDown in class Controllerpublic void addBehavior(Behavior b)
b - the Behavior to be added.
DuplicateOutputKeyException - if another Behavior is already using
the output key specified for the new Behavior.
IllegalStateException - if a Behavior is added to a Controller that
has already been started up, but not yet shut down.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||