Esempio n. 1
0
 public Arbitrator(List<Behaviour> behaviours) {
   this.behaviours = behaviours;
   monitor = new Monitor();
   monitor.setDaemon(true);
 }
Esempio n. 2
0
 /**
  * Allocates an Arbitrator object and initializes it with an array of behaviour objects. The index
  * of a behaviour in this array is its priority level, so the behaviour of the largest index has
  * the highest the priority level. The behaviours in an Arbitrator can not be changed once the
  * arbitrator is initialized.<br>
  * <B>NOTE:</B> Once the Arbitrator is initialized, the method start() must be called to begin the
  * arbitration.
  *
  * @param behaviourList an array of behaviour objects.
  * @param returnWhenInactive if <B>true</B>, the <B>start()</B> method returns when no behaviour
  *     is active.
  */
 public MyArbitrator(Behaviour[] behaviourList, boolean returnWhenInactive) {
   _behaviour = behaviourList;
   _returnWhenInactive = returnWhenInactive;
   monitor = new Monitor();
   monitor.setDaemon(true);
 }