org.jactr.core.production.action
Class SetAction

java.lang.Object
  extended by org.jactr.core.production.action.DefaultAction
      extended by org.jactr.core.production.action.SetAction
All Implemented Interfaces:
IAction, IBufferAction, ISlotContainer

public class SetAction
extends DefaultAction
implements ISlotContainer, IBufferAction

a zero-time buffer content set operator

Author:
harrison

Nested Class Summary
 class SetAction.SetActionTimedEvent
           
 
Constructor Summary
SetAction(java.lang.String bufferName, java.lang.Object referant)
           
SetAction(java.lang.String bufferName, java.lang.Object referant, java.util.Collection<? extends ISlot> slots)
           
 
Method Summary
 void addSlot(ISlot slot)
          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.
 void dispose()
          Description of the Method
 double fire(IInstantiation instantiation, double firingTime)
          Description of the Method
 java.lang.String getBufferName()
           
 java.lang.Object getReferant()
           
 java.util.Collection<? extends ISlot> getSlots()
          return a duplicate copy of all the slots
 java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> container)
           
 void removeSlot(ISlot slot)
          remove a slot
 void setBufferName(java.lang.String bufferName)
          set the name of the buffer that this action manipulates
 void setReferant(java.lang.Object ref)
           
 
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

SetAction

public SetAction(java.lang.String bufferName,
                 java.lang.Object referant)

SetAction

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

dispose

public void dispose()
Description copied from class: DefaultAction
Description of the Method

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

addSlot

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

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

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> container)
Specified by:
getSlots in interface ISlotContainer

removeSlot

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

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

getBufferName

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

setBufferName

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

Specified by:
setBufferName in interface IBufferAction

getReferant

public java.lang.Object getReferant()

setReferant

public void setReferant(java.lang.Object ref)

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

fire

public double fire(IInstantiation instantiation,
                   double firingTime)
Description copied from class: DefaultAction
Description of the Method

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