org.jactr.core.buffer.six
Class AbstractActivationBuffer6

java.lang.Object
  extended by org.jactr.core.buffer.AbstractActivationBuffer
      extended by org.jactr.core.buffer.six.AbstractActivationBuffer6
All Implemented Interfaces:
IActivationBuffer, IStatusBuffer, ISlotContainer, IUniqueSlotContainer, IInitializable, IParameterized
Direct Known Subclasses:
AbstractRequestableBuffer6, BasicBuffer6

public abstract class AbstractActivationBuffer6
extends AbstractActivationBuffer
implements IStatusBuffer

template for an activation buffer that handles it's own status and inserts only copies of chunks

Author:
developer

Field Summary
 
Fields inherited from class org.jactr.core.buffer.AbstractActivationBuffer
ACTIVATION_PARAM, GOAL_VALUE_PARAM, STRICT_HARVESTING_PARAM
 
Fields inherited from interface org.jactr.core.buffer.six.IStatusBuffer
BUFFER_SLOT, STATE_SLOT
 
Fields inherited from interface org.jactr.core.buffer.IActivationBuffer
AURAL, AURAL_LOCATION, GOAL, IMAGINAL, MOTOR, RETRIEVAL, VISUAL, VISUAL_LOCATION, VOCAL
 
Constructor Summary
AbstractActivationBuffer6(java.lang.String name, IModule module)
           
 
Method Summary
 void addSlot(ISlot slot)
          Adds a slot
 IChunk addSourceChunk(IChunk sourceChunk)
          ensure that all chunks added are copies
 int bind(SlotBasedRequest request, java.util.Map<java.lang.String,java.lang.Object> bindings, boolean isIterative)
          Required to permit status buffers to participate in the variable binding process of production instantiation.
 void dispose()
          clean up resources, called by the module that created the buffer
 IChunk getBusyChunk()
           
 IChunk getEmptyChunk()
           
 IChunk getErrorChunk()
           
 IChunk getFreeChunk()
           
 IChunk getFullChunk()
           
 IChunk getRequestedChunk()
           
 ISlot getSlot(java.lang.String name)
          return the actual named slot.
 java.util.Collection<? extends ISlot> getSlots()
          return a duplicate copy of all the slots
 java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
           
 IChunk getUnrequestedChunk()
           
 void initialize()
          must be called after the model has started so that we can ensure that the status slot values are properly initialized
 boolean isBufferEmpty()
          this actually checks the contents of the buffer slot which might not be the best test in the case of buffers that share a common set of state slots (i.e.
 boolean isBufferFull()
           
 boolean isBufferRequested()
           
 boolean isBufferUnrequested()
           
 boolean isStateBusy()
           
 boolean isStateError()
           
 boolean isStateFree()
           
 void removeSlot(ISlot slot)
          remove a slot
 void setBufferChunk(IChunk bufferState)
           
 void setStateChunk(IChunk chunk)
           
 
Methods inherited from class org.jactr.core.buffer.AbstractActivationBuffer
addListener, clear, contains, getActivation, getG, getModel, getModule, getName, getParameter, getPossibleParameters, getSetableParameters, getSourceChunk, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG, setParameter, setStrictHarvestingEnabled, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jactr.core.buffer.IActivationBuffer
addListener, clear, contains, getActivation, getG, getModel, getModule, getName, getSourceChunk, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG
 

Constructor Detail

AbstractActivationBuffer6

public AbstractActivationBuffer6(java.lang.String name,
                                 IModule module)
Method Detail

dispose

public void dispose()
Description copied from interface: IActivationBuffer
clean up resources, called by the module that created the buffer

Specified by:
dispose in interface IActivationBuffer
Overrides:
dispose in class AbstractActivationBuffer

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

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

getSlot

public ISlot getSlot(java.lang.String name)
Description copied from interface: IUniqueSlotContainer
return the actual named slot. this is the backing slot, changes to it are propogated throughout the model

Specified by:
getSlot in interface IUniqueSlotContainer
Returns:

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

isStateFree

public boolean isStateFree()
Specified by:
isStateFree in interface IStatusBuffer

isStateBusy

public boolean isStateBusy()
Specified by:
isStateBusy in interface IStatusBuffer

isStateError

public boolean isStateError()
Specified by:
isStateError in interface IStatusBuffer

isBufferUnrequested

public boolean isBufferUnrequested()
Specified by:
isBufferUnrequested in interface IStatusBuffer

isBufferRequested

public boolean isBufferRequested()
Specified by:
isBufferRequested in interface IStatusBuffer

isBufferFull

public boolean isBufferFull()
Specified by:
isBufferFull in interface IStatusBuffer

isBufferEmpty

public boolean isBufferEmpty()
this actually checks the contents of the buffer slot which might not be the best test in the case of buffers that share a common set of state slots (i.e. visual and visual-location)

Specified by:
isBufferEmpty in interface IStatusBuffer
See Also:
IStatusBuffer.isBufferEmpty()

setStateChunk

public void setStateChunk(IChunk chunk)
Specified by:
setStateChunk in interface IStatusBuffer

setBufferChunk

public void setBufferChunk(IChunk bufferState)
Specified by:
setBufferChunk in interface IStatusBuffer

getFreeChunk

public IChunk getFreeChunk()

getBusyChunk

public IChunk getBusyChunk()

getEmptyChunk

public IChunk getEmptyChunk()

getFullChunk

public IChunk getFullChunk()

getErrorChunk

public IChunk getErrorChunk()

getRequestedChunk

public IChunk getRequestedChunk()

getUnrequestedChunk

public IChunk getUnrequestedChunk()

initialize

public void initialize()
must be called after the model has started so that we can ensure that the status slot values are properly initialized

Specified by:
initialize in interface IInitializable
Overrides:
initialize in class AbstractActivationBuffer

addSourceChunk

public IChunk addSourceChunk(IChunk sourceChunk)
ensure that all chunks added are copies

Specified by:
addSourceChunk in interface IActivationBuffer
Overrides:
addSourceChunk in class AbstractActivationBuffer
Parameters:
sourceChunk - chunk to be added
Returns:
the actual chunk added (in case a copy was made)
See Also:
IActivationBuffer.addSourceChunk(org.jactr.core.chunk.IChunk)

bind

public int bind(SlotBasedRequest request,
                java.util.Map<java.lang.String,java.lang.Object> bindings,
                boolean isIterative)
         throws CannotMatchException
Description copied from interface: IStatusBuffer
Required to permit status buffers to participate in the variable binding process of production instantiation. Since we don't know a priori what the slots the status buffers will contain or their possible values, it is up to the status buffers to attempt to bind variable values

Specified by:
bind in interface IStatusBuffer
Returns:
Throws:
CannotMatchException