org.jactr.core.production.action
Class ModifyAction

java.lang.Object
  extended by org.jactr.core.production.action.DefaultAction
      extended by org.jactr.core.production.action.ModifyAction
All Implemented Interfaces:
IAction, IBufferAction, ISlotContainer
Direct Known Subclasses:
RemoveAction

public class ModifyAction
extends DefaultAction
implements IBufferAction, ISlotContainer

The ModifyAction is used to modify the slot values of a chunk residing within a specific buffer. The IChunk is neither added nor removed. If upon firing there is no chunk in the buffer, an IllegalActionStateException is thrown.

Author:
harrison

Nested Class Summary
 class ModifyAction.ModifyActionTimedEvent
           
 
Constructor Summary
ModifyAction()
          Constructor for the ModifyAction object
ModifyAction(java.lang.String bufferName)
          Constructor merely takes the name of the buffer where the chunk will reside.
ModifyAction(java.lang.String bufferName, java.util.Collection<? extends ISlot> slots)
           
 
Method Summary
 void addSlot(ISlot s)
          Adds a slot
 IAction bind(java.util.Map<java.lang.String,java.lang.Object> variableBindings)
          Bind is called during the creation of an instantiation of a produciton.
 boolean canModify()
          Description of the Method
 void dispose()
          Description of the Method
 double fire(IInstantiation instantiation, double firingTime)
          fire this modify action this will actually post a timed event to the timed event queue that will do the work..
 java.lang.String getBufferName()
           
 java.util.Collection<? extends ISlot> getSlots()
          return a duplicate copy of all the slots
 java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
           
 void removeSlot(ISlot s)
          remove a slot
 void setBufferName(java.lang.String name)
          set the name of the buffer that this action manipulates
 
Methods inherited from class org.jactr.core.production.action.DefaultAction
resolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyAction

public ModifyAction(java.lang.String bufferName)
Constructor merely takes the name of the buffer where the chunk will reside.

Parameters:
bufferName - Description of Parameter
Since:

ModifyAction

public ModifyAction()
Constructor for the ModifyAction object

Since:

ModifyAction

public ModifyAction(java.lang.String bufferName,
                    java.util.Collection<? extends ISlot> slots)
Method Detail

dispose

public void dispose()
Description of the Method

Specified by:
dispose in interface IAction
Overrides:
dispose in class DefaultAction
Since:

canModify

public boolean canModify()
Description of the Method

Returns:
Description of the Return Value

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

getBufferName

public java.lang.String getBufferName()
Specified by:
getBufferName in interface IBufferAction

setBufferName

public void setBufferName(java.lang.String name)
Description copied from interface: IBufferAction
set the name of the buffer that this action manipulates

Specified by:
setBufferName in interface IBufferAction

getSlots

public java.util.Collection<? extends ISlot> getSlots()
Description copied from interface: ISlotContainer
return a duplicate copy of all the slots

Specified by:
getSlots in interface ISlotContainer
Returns:
The slots value

getSlots

public java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
Specified by:
getSlots in interface ISlotContainer

addSlot

public void addSlot(ISlot s)
Description copied from interface: ISlotContainer
Adds a slot

Specified by:
addSlot in interface ISlotContainer
Parameters:
s - The feature to be added to the ISlot attribute

removeSlot

public void removeSlot(ISlot s)
Description copied from interface: ISlotContainer
remove a slot

Specified by:
removeSlot in interface ISlotContainer
Parameters:
s - Description of Parameter

fire

public double fire(IInstantiation instantiation,
                   double firingTime)
fire this modify action this will actually post a timed event to the timed event queue that will do the work..

Specified by:
fire in interface IAction
Specified by:
fire in class DefaultAction
Parameters:
instantiation - Description of the Parameter
firingTime - when this production was fired
Returns:
Description of the Return Value
Since: