public abstract class AbstractPMActivationBuffer6 extends DefaultDelegatedRequestableBuffer6 implements IDelegatedRequestableBuffer, IPerceptualBuffer, IEventTrackingActivationBuffer, ICompilableBuffer
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<ITimedEvent> |
_pendingTimedEvents
we track all timed events used for this buffer so that if a clear comes in,
we can abort
|
ACTIVATION_PARAM, GOAL_VALUE_PARAM, STRICT_HARVESTING_PARAM
EXECUTION_SLOT, IS_BUFFER_STUFF_REQUEST, MODALITY_SLOT, PREPARATION_SLOT, PROCESSOR_SLOT
BUFFER_SLOT, ERROR_CHANGED_TOO_MUCH_CHUNK, ERROR_DELETED_CHUNK, ERROR_INVALID_INDEX_CHUNK, ERROR_NO_LONGER_AVAILABLE_CHUNK, ERROR_NOTHING_AVAILABLE_CHUNK, ERROR_NOTHING_MATCHES_CHUNK, ERROR_SLOT, ERROR_UNKNOWN_CHUNK, STATE_SLOT
AURAL, AURAL_LOCATION, GOAL, IMAGINAL, MOTOR, RETRIEVAL, VISUAL, VISUAL_LOCATION, VOCAL
Constructor and Description |
---|
AbstractPMActivationBuffer6(java.lang.String name,
IModule module) |
Modifier and Type | Method and Description |
---|---|
protected IChunk |
addSourceChunkInternal(IChunk chunkToInsert)
return the source chunk that was actually inserted into the buffer (i.e.
|
void |
clear()
will call removeSourceChunkInternal for all the chunks and then recalculate
activation
|
protected java.util.Collection<IChunk> |
clearInternal()
clear the buffer and abort any timed events that are pending
|
void |
dispose()
clean up resources, called by the module that created the buffer
|
void |
enqueueTimedEvent(ITimedEvent timedEvent)
called when we want to queue a timed event onto the model's event queue
this also tracks all the pending events so that if they fire or get aborted
we are notified, and it permits us to abort when a clear is called
|
ICompilableContext |
getCompilableContext() |
protected void |
grabReferences()
called once the model is started.
|
void |
initialize()
intialize this component
|
boolean |
isExecutionBusy() |
boolean |
isExecutionFree() |
boolean |
isModalityBusy() |
boolean |
isModalityFree() |
boolean |
isPreparationBusy() |
boolean |
isPreparationFree() |
boolean |
isProcessorBusy() |
boolean |
isProcessorFree() |
protected abstract boolean |
isValidChunkType(IChunkType chunkType)
check to see if a chunk of this chunktype can be added as a source chunk
|
protected boolean |
removeSourceChunkInternal(IChunk chunkToRemove)
do the actual work of removing chunkToRemove from the buffer.
|
void |
setExecutionChunk(IChunk chunk) |
void |
setModalityChunk(IChunk chunk) |
void |
setPreparationChunk(IChunk chunk) |
void |
setProcessorChunk(IChunk chunk) |
protected boolean |
shouldCopyOnInsertion(IChunk chunk)
the super type uses a more specific test, but since we know perceptual
buffers are only going to be continaing the sanctioned perceptual chunks,
we don't need to do all the buffer containment tests and just the encoding
test should suffice.
|
boolean |
willAccept(IRequest request)
return true if this buffer would accept this request
|
addRequestDelegate, getRequestDelegates, getSourceChunkInternal, getSourceChunksInternal, removeRequestDelegate, requestInternal, setSourceChunkInternal
request
addListener, addSlot, addSourceChunk, bind, checkStatusSlotContent, getBusyChunk, getEmptyChunk, getErrorChunk, getFreeChunk, getFullChunk, getRequestedChunk, getSlot, getSlots, getSlots, getUnrequestedChunk, hasSlot, isBufferEmpty, isBufferFull, isBufferRequested, isBufferUnrequested, isErrorSet, isStateBusy, isStateError, isStateFree, removeListener, removeSlot, setBufferChunk, setErrorChunk, setStateChunk, setStatusSlotContent, shouldAcceptAsSource, sourceChunkCopied, valueChanged
addListener, contains, containsExact, getActivation, getActivationSpreader, getEventDispatcher, getG, getLock, getModel, getModule, getName, getParameter, getPossibleParameters, getSetableParameters, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, matchedInternal, removeListener, removeSourceChunk, setActivation, setActivationSpreader, setG, setParameter, setStrictHarvestingEnabled, toString
addAdapterFactory, getAdapter, removeAdapterFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bind, isBufferEmpty, isBufferFull, isBufferRequested, isBufferUnrequested, isErrorSet, isStateBusy, isStateError, isStateFree, setBufferChunk, setErrorChunk, setStateChunk
addListener, removeListener, valueChanged
getSlot, hasSlot
addSlot, getSlots, getSlots, removeSlot
addRequestDelegate, getRequestDelegates, removeRequestDelegate
request
addListener, addSourceChunk, contains, getActivation, getG, getModel, getModule, getName, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG
getAdapter
protected java.util.Collection<ITimedEvent> _pendingTimedEvents
public AbstractPMActivationBuffer6(java.lang.String name, IModule module)
public void dispose()
IActivationBuffer
dispose
in interface IActivationBuffer
dispose
in class AbstractActivationBuffer6
public void initialize()
IInitializable
initialize
in interface IInitializable
initialize
in class AbstractActivationBuffer
protected void grabReferences()
AbstractActivationBuffer
grabReferences
in class AbstractActivationBuffer6
protected java.util.Collection<IChunk> clearInternal()
clearInternal
in class DefaultDelegatedRequestableBuffer6
AbstractActivationBuffer.clear()
public void clear()
AbstractActivationBuffer
clear
in interface IActivationBuffer
clear
in class AbstractActivationBuffer
IActivationBuffer.clear()
protected boolean shouldCopyOnInsertion(IChunk chunk)
shouldCopyOnInsertion
in class AbstractActivationBuffer6
public void enqueueTimedEvent(ITimedEvent timedEvent)
enqueueTimedEvent
in interface IEventTrackingActivationBuffer
timedEvent
- protected abstract boolean isValidChunkType(IChunkType chunkType)
chunkType
- protected IChunk addSourceChunkInternal(IChunk chunkToInsert)
AbstractActivationBuffer
addSourceChunkInternal
in class DefaultDelegatedRequestableBuffer6
chunkToInsert
- the chunk to be inserted, will never be null nor already in the
bufferprotected boolean removeSourceChunkInternal(IChunk chunkToRemove)
AbstractActivationBuffer
removeSourceChunkInternal
in class DefaultDelegatedRequestableBuffer6
chunkToRemove
- chunk that is in the buffer, never nullAbstractActivationBuffer.removeSourceChunkInternal(org.jactr.core.chunk.IChunk)
public boolean willAccept(IRequest request)
IRequestableBuffer
willAccept
in interface IRequestableBuffer
willAccept
in class DefaultDelegatedRequestableBuffer6
public boolean isModalityFree()
isModalityFree
in interface IPerceptualBuffer
public boolean isProcessorFree()
isProcessorFree
in interface IPerceptualBuffer
public boolean isPreparationFree()
isPreparationFree
in interface IPerceptualBuffer
public boolean isExecutionFree()
isExecutionFree
in interface IPerceptualBuffer
public boolean isModalityBusy()
isModalityBusy
in interface IPerceptualBuffer
public boolean isProcessorBusy()
isProcessorBusy
in interface IPerceptualBuffer
public boolean isPreparationBusy()
isPreparationBusy
in interface IPerceptualBuffer
public boolean isExecutionBusy()
isExecutionBusy
in interface IPerceptualBuffer
public void setModalityChunk(IChunk chunk)
setModalityChunk
in interface IPerceptualBuffer
public void setExecutionChunk(IChunk chunk)
setExecutionChunk
in interface IPerceptualBuffer
public void setPreparationChunk(IChunk chunk)
setPreparationChunk
in interface IPerceptualBuffer
public void setProcessorChunk(IChunk chunk)
setProcessorChunk
in interface IPerceptualBuffer
public ICompilableContext getCompilableContext()
getCompilableContext
in interface ICompilableBuffer