org.jactr.core.production.action
Class SleepAction

java.lang.Object
  extended by org.jactr.core.production.action.SleepAction
All Implemented Interfaces:
IAction

public class SleepAction
extends java.lang.Object
implements IAction

An action, that when fired will block the model thread until a chunk appears in the goal buffer

Author:
developer

Constructor Summary
SleepAction()
           
 
Method Summary
 IAction bind(java.util.Map<java.lang.String,java.lang.Object> variableBindings)
          Bind is called during the creation of an instantiation of a produciton.
 void dispose()
          Dispose is called to explicitly release resources when we are done with the IAction.
 double fire(IInstantiation instantiation, double firingTime)
          wait until the goal buffer isn't empty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SleepAction

public SleepAction()
Method Detail

bind

public IAction bind(java.util.Map<java.lang.String,java.lang.Object> variableBindings)
             throws CannotInstantiateException
Description copied from interface: IAction
Bind is called during the creation of an instantiation of a produciton. By the time this gets called, we know that all the conditions are matched and all the variables have been assigned. This method merely creates a copy of this action and applies those bindings. the IAction returned by this method will be the actual one that is fired. Normally, an action should not change the contents of variableBindings

Specified by:
bind in interface IAction
Returns:
Throws:
CannotInstantiateException
See Also:
IAction.bind(java.util.Map)

dispose

public void dispose()
Description copied from interface: IAction
Dispose is called to explicitly release resources when we are done with the IAction. Why not rely upon the finalization mechanism and garbage collection? Many of the classes contain circular linkages: parent to child and child to parent. Since the garbage collection contract is not standardized, circular links might prevent objects from being collected. This method should never be called by the programmer. It is called by the containing IProduction, which in turn has its dispose method called by the IModel. You should only call IModel.dispose() when you are done with the model.

Specified by:
dispose in interface IAction
See Also:
IAction.dispose()

fire

public double fire(IInstantiation instantiation,
                   double firingTime)
wait until the goal buffer isn't empty

Specified by:
fire in interface IAction
firingTime - when this production was fired
See Also:
IAction.fire(org.jactr.core.production.IInstantiation, double)