org.jactr.core.production.action
Class RemoveAction
java.lang.Object
org.jactr.core.production.action.DefaultAction
org.jactr.core.production.action.ModifyAction
org.jactr.core.production.action.RemoveAction
- All Implemented Interfaces:
- IAction, IBufferAction, ISlotContainer
public class RemoveAction
- extends ModifyAction
- implements IBufferAction
The remove action does just that. It removes a chunk from a named buffer.
Since buffers currently only contain one chunk, remove needs not specify
anything other than the buffer name. If the named buffer doesn?t contain a
chunk, no action is taken.
|
Constructor Summary |
RemoveAction()
Constructor for the RemoveAction object |
RemoveAction(java.lang.String bufferName)
Constructor for the RemoveAction object |
RemoveAction(java.lang.String bufferName,
java.util.Collection<? extends ISlot> slots)
|
|
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. |
double |
fire(IInstantiation instantiation,
double firingTime)
post an event that will remove the contents of the buffer. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jactr.core.production.action.IAction |
dispose |
RemoveAction
public RemoveAction(java.lang.String bufferName)
- Constructor for the RemoveAction object
- Parameters:
bufferName - Description of the Parameter
RemoveAction
public RemoveAction()
- Constructor for the RemoveAction object
RemoveAction
public RemoveAction(java.lang.String bufferName,
java.util.Collection<? extends ISlot> slots)
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- Overrides:
bind in class ModifyAction
- Returns:
-
- Throws:
CannotInstantiateException
fire
public double fire(IInstantiation instantiation,
double firingTime)
- post an event that will remove the contents of the buffer. We post an event
because this is SOP.
- Specified by:
fire in interface IAction- Overrides:
fire in class ModifyAction
- Parameters:
instantiation - Description of the ParameterfiringTime - when this production was fired
- Returns:
- Description of the Return Value