public abstract class AbstractCapacityPMActivationBuffer6 extends AbstractCapacityBuffer6 implements IDelegatedRequestableBuffer, IPerceptualBuffer, IEventTrackingActivationBuffer, ICompilableBuffer
ICapacityBuffer.EjectionPolicy
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<IRequestDelegate> |
_chunkPatternProcessors |
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
|
_ejectionPolicy
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
EJECTION_POLICY_PARAM
Constructor and Description |
---|
AbstractCapacityPMActivationBuffer6(java.lang.String name,
IModule module) |
Modifier and Type | Method and Description |
---|---|
void |
addRequestDelegate(IRequestDelegate processor) |
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() |
java.util.Collection<IRequestDelegate> |
getRequestDelegates()
returns the actual backing collection
|
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
|
void |
removeRequestDelegate(IRequestDelegate processor) |
protected boolean |
requestInternal(IRequest request,
double requestTime)
actually do the work of the request.
|
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
|
addSourceChunkInternal, chunkInserted, chunkRemoved, getChunksAndTimes, getEjectionPolicy, getParameter, getPossibleParameters, getSetableParameters, getSourceChunkInternal, getSourceChunksInternal, getTimesAndChunks, isCapacityReached, matchedInternal, removeSourceChunkInternal, setEjectionPolicy, setParameter
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, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setActivationSpreader, setG, 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
request
addListener, addSourceChunk, contains, getActivation, getG, getModel, getModule, getName, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG
getAdapter
getSourceChunks
protected java.util.Collection<IRequestDelegate> _chunkPatternProcessors
protected java.util.Collection<ITimedEvent> _pendingTimedEvents
public AbstractCapacityPMActivationBuffer6(java.lang.String name, IModule module)
public void dispose()
IActivationBuffer
dispose
in interface IActivationBuffer
dispose
in class AbstractCapacityBuffer6
public void initialize()
IInitializable
initialize
in interface IInitializable
initialize
in class AbstractCapacityBuffer6
protected void grabReferences()
AbstractActivationBuffer
grabReferences
in class AbstractActivationBuffer6
protected boolean shouldCopyOnInsertion(IChunk chunk)
shouldCopyOnInsertion
in class AbstractActivationBuffer6
protected java.util.Collection<IChunk> clearInternal()
clearInternal
in class AbstractActivationBuffer6
AbstractActivationBuffer.clear()
public void clear()
AbstractActivationBuffer
clear
in interface IActivationBuffer
clear
in class AbstractActivationBuffer
IActivationBuffer.clear()
public void enqueueTimedEvent(ITimedEvent timedEvent)
enqueueTimedEvent
in interface IEventTrackingActivationBuffer
timedEvent
- protected abstract boolean isValidChunkType(IChunkType chunkType)
isValidChunkType
in class AbstractCapacityBuffer6
chunkType
- public void addRequestDelegate(IRequestDelegate processor)
addRequestDelegate
in interface IDelegatedRequestableBuffer
public void removeRequestDelegate(IRequestDelegate processor)
removeRequestDelegate
in interface IDelegatedRequestableBuffer
public java.util.Collection<IRequestDelegate> getRequestDelegates()
getRequestDelegates
in interface IDelegatedRequestableBuffer
public boolean willAccept(IRequest request)
IRequestableBuffer
willAccept
in interface IRequestableBuffer
protected boolean requestInternal(IRequest request, double requestTime) throws java.lang.IllegalArgumentException
AbstractRequestableBuffer6
requestInternal
in class AbstractRequestableBuffer6
java.lang.IllegalArgumentException
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