|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.subsumption.Arbitrator2
public class Arbitrator2
Arbitrator2 controls which behavior should currently be active in a behavior control system. This implementation is simpler than the original, but the behaviors it uses must implement the Behavior2 interface. In this architecture, when a behavior wants control, it must call arbitrator.wantControl();
| Constructor Summary | |
|---|---|
Arbitrator2(Behavior2[] behaviors)
Allocates an Arbitrator2 object and initializes it with an array of Behavior2 objects. |
|
| Method Summary | |
|---|---|
void |
start()
This method starts the arbitration of Behaviors. It iterates over the array of behaviors, highest priority first. |
void |
wantControl(Behavior2 theBehavior)
If the behavior that sent this message has higher priority than the active behavior, the active behavior is suppressed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
| Constructor Detail |
|---|
public Arbitrator2(Behavior2[] behaviors)
behaviors - An array of Behavior objects. The behavior of largest index has the highest proiroty.| Method Detail |
|---|
public void start()
public void wantControl(Behavior2 theBehavior)
theBehavior -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||