ubiware.core.commands
Class RabRunnable

java.lang.Object
  extended by ubiware.core.AgentWrapper
      extended by ubiware.core.commands.RabRunnable
All Implemented Interfaces:
java.lang.Runnable

public abstract class RabRunnable
extends AgentWrapper
implements java.lang.Runnable

The extra point (compared to Runnable) is that inside the run method, the implementer has access to other methods provided by this class. NEVER run this class from inside the UbiwareAgent thread (This means, not from in the thread which goes trough RAB's) This will cause a deadlock! Use in a newly created thread. example:

 
 class RabRunnableExampleBehavior extends ReusableAtomicBehavior {
 
        
        protected void doAction() {
                //........
                new Thread(new RabRunnable(this.myAgent) {
                        
                        public void run() {
                                //access to the agents beliefs
                                this.AddBeliefsN3Blocking(":bill :hasSon :John");
                                //in the next line, we're sure that the beliefs have been added, since this was the blocking variety!
 
                        }
                }).start();
                //..........
 
        }
 
        protected void initializeRAB(BehaviorStartParameters parameters) throws IllegalParameterConfigurationException {...}
 
 }
 
15.3.2010

Author:
Michael Cochez for UBIWARE project

Constructor Summary
RabRunnable(UbiwareAgent myAgent)
           
 
Method Summary
 
Methods inherited from class ubiware.core.AgentWrapper
addBeliefsN3, addBeliefsN3Blocking, addCommand, hasBeliefsN3Blocking, removeBeliefsN3, removeBeliefsN3Blocking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

RabRunnable

public RabRunnable(UbiwareAgent myAgent)