org.jactr.modules.pm.aural
Class AbstractAuralModule

java.lang.Object
  extended by org.jactr.core.module.AbstractModule
      extended by org.jactr.core.module.asynch.AbstractAsynchronousModule
          extended by org.jactr.modules.pm.AbstractPerceptualModule
              extended by org.jactr.modules.pm.aural.AbstractAuralModule
All Implemented Interfaces:
IAsynchronousModule, IModule, IInitializable, IInstallable, IParameterized, IAuralModule, IPerceptualMemoryModule, IPerceptualModule
Direct Known Subclasses:
DefaultAuralModule6

public abstract class AbstractAuralModule
extends AbstractPerceptualModule
implements IAuralModule, IParameterized

abstract implementation of the aural module that takes care of most of the details. It handles parameter, FINST management, and buffer stuffing. It is up to the extenders to deal with the actual attending, search, buffer and memory creation.

Author:
developer

Field Summary
static java.lang.String AURAL_DECAY_TIME_PARAM
           
static java.lang.String ENABLE_BUFFER_STUFF_PARAM
           
static java.lang.String ENCODING_TIME_EQUATION_PARAM
           
 
Fields inherited from interface org.jactr.modules.pm.aural.IAuralModule
ATTENDED_STATUS_SLOT, AUDIO_EVENT_CHUNK_TYPE, AURAL_BUFFER, AURAL_LOCATION_BUFFER, AZIMUTH_SLOT, CLEAR_CHUNK_TYPE, CONTENT_SLOT, DIGIT_CHUNK_TYPE, DURATION_SLOT, ELEVATION_SLOT, EVENT_SLOT, EXTERNAL_CHUNK, INTERNAL_CHUNK, KIND_SLOT, LOCATION_SLOT, OFFSET_SLOT, ONSET_SLOT, PITCH_SLOT, SOUND_CHUNK_TYPE, SPEECH_CHUNK_TYPE, TONE_CHUNK_TYPE, WORD_CHUNK_TYPE
 
Fields inherited from interface org.jactr.modules.pm.IPerceptualModule
GREATER_THAN_CURRENT_CHUNK, HIGHEST_CHUNK, LESS_THAN_CURRENT_CHUNK, LOWEST_CHUNK
 
Fields inherited from interface org.jactr.core.module.asynch.IAsynchronousModule
STRICT_SYNCHRONIZATION_PARAM
 
Constructor Summary
AbstractAuralModule()
           
 
Method Summary
 void addListener(IAuralModuleListener listener, java.util.concurrent.Executor executor)
           
 void dispatch(AuralModuleEvent event)
           
 void dispose()
          release any resources.
 IChunkType getAudioEventChunkType()
           
 IAuralActivationBuffer getAuralActivationBuffer()
           
 double getAuralDecayTime()
          how long does a sound take to decay out of the audicon
 IAuralLocationBuffer getAuralLocationBuffer()
           
 IAuralMemory getAuralMemory()
          return the backing aural memory.
 IChunkType getClearChunkType()
           
 IAuralEncodingTimeEquation getEncodingTimeEquation()
           
 IChunk getExternalChunk()
           
 IChunk getHighestChunk()
           
 IChunk getInternalChunk()
           
 IChunk getLowestChunk()
           
 java.lang.String getParameter(java.lang.String key)
          return parameter value - null if not defined.
 IPerceptualMemory getPerceptualMemory()
           
 double getRecodeTime(IChunkType chunkType)
           
 java.util.Collection<java.lang.String> getSetableParameters()
          Return list of all parameters that can be set.
 IChunkType getSoundChunkType()
           
 boolean hasListeners()
           
 void initialize()
          this will be called after all the modules have been installed permitting the module to attach listeners to other modules.
 boolean isBufferStuffEnabled()
           
 void removeListener(IAuralModuleListener listener)
           
 void setAuralDecayTime(double time)
           
 void setParameter(java.lang.String key, java.lang.String value)
          Set the named parameter
 void setRecodeTime(IChunkType chunkType, double time)
           
 
Methods inherited from class org.jactr.modules.pm.AbstractPerceptualModule
getBusyChunk, getCommonRealityExecutor, getErrorChunk, getExecutor, getFreeChunk, getRequestedChunk, getSymbolGrounder, getUnrequestedChunk
 
Methods inherited from class org.jactr.core.module.asynch.AbstractAsynchronousModule
getPossibleParameters, isStrictSynchronizationEnabled, setStrictSynchronizationEnabled, synchronizedTimedEvent
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, getModel, getName, immediateFuture, immediateReturn, install, uninstall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.modules.pm.aural.IAuralModule
reset
 
Methods inherited from interface org.jactr.modules.pm.IPerceptualMemoryModule
attendTo, search
 
Methods inherited from interface org.jactr.modules.pm.IPerceptualModule
getCommonRealityExecutor, getSymbolGrounder
 
Methods inherited from interface org.jactr.core.module.asynch.IAsynchronousModule
getExecutor, isStrictSynchronizationEnabled, setStrictSynchronizationEnabled, synchronizedTimedEvent
 
Methods inherited from interface org.jactr.core.module.IModule
getModel, getName, install, reset
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 
Methods inherited from interface org.jactr.core.utils.parameter.IParameterized
getPossibleParameters
 

Field Detail

ENABLE_BUFFER_STUFF_PARAM

public static final java.lang.String ENABLE_BUFFER_STUFF_PARAM
See Also:
Constant Field Values

AURAL_DECAY_TIME_PARAM

public static final java.lang.String AURAL_DECAY_TIME_PARAM
See Also:
Constant Field Values

ENCODING_TIME_EQUATION_PARAM

public static final java.lang.String ENCODING_TIME_EQUATION_PARAM
See Also:
Constant Field Values
Constructor Detail

AbstractAuralModule

public AbstractAuralModule()
Parameters:
name -
Method Detail

addListener

public void addListener(IAuralModuleListener listener,
                        java.util.concurrent.Executor executor)
Specified by:
addListener in interface IAuralModule

removeListener

public void removeListener(IAuralModuleListener listener)
Specified by:
removeListener in interface IAuralModule

hasListeners

public boolean hasListeners()
Specified by:
hasListeners in interface IAuralModule

dispatch

public void dispatch(AuralModuleEvent event)
Specified by:
dispatch in interface IAuralModule

initialize

public void initialize()
Description copied from interface: IModule
this will be called after all the modules have been installed permitting the module to attach listeners to other modules. if you want to get access to chunks,types, or productions before the model runs, attach a model listener and do that during the modelStarted call

Specified by:
initialize in interface IModule
Specified by:
initialize in interface IInitializable
Overrides:
initialize in class AbstractPerceptualModule
See Also:
AbstractModule.initialize()

dispose

public void dispose()
Description copied from interface: IModule
release any resources. this should only be called by the model during its own dispose method (assuming that this module is still installed) and should not result in the propogation of ANY events. The module should dispose of all its resources, including buffers

Specified by:
dispose in interface IModule
Overrides:
dispose in class AbstractPerceptualModule

isBufferStuffEnabled

public boolean isBufferStuffEnabled()

getAuralMemory

public IAuralMemory getAuralMemory()
Description copied from interface: IAuralModule
return the backing aural memory. this is only valid after the module has been connected to CR.

Specified by:
getAuralMemory in interface IAuralModule
Returns:

getPerceptualMemory

public IPerceptualMemory getPerceptualMemory()
Specified by:
getPerceptualMemory in interface IPerceptualMemoryModule

getAuralActivationBuffer

public IAuralActivationBuffer getAuralActivationBuffer()
Specified by:
getAuralActivationBuffer in interface IAuralModule
See Also:
IAuralModule.getAuralActivationBuffer()

getAuralLocationBuffer

public IAuralLocationBuffer getAuralLocationBuffer()
Specified by:
getAuralLocationBuffer in interface IAuralModule
See Also:
IAuralModule.getAuralLocationBuffer()

getEncodingTimeEquation

public IAuralEncodingTimeEquation getEncodingTimeEquation()
Specified by:
getEncodingTimeEquation in interface IAuralModule

getClearChunkType

public IChunkType getClearChunkType()
Specified by:
getClearChunkType in interface IAuralModule

getSoundChunkType

public IChunkType getSoundChunkType()
Specified by:
getSoundChunkType in interface IAuralModule

getAudioEventChunkType

public IChunkType getAudioEventChunkType()
Specified by:
getAudioEventChunkType in interface IAuralModule

getLowestChunk

public IChunk getLowestChunk()
Specified by:
getLowestChunk in interface IAuralModule

getHighestChunk

public IChunk getHighestChunk()
Specified by:
getHighestChunk in interface IAuralModule

getInternalChunk

public IChunk getInternalChunk()
Specified by:
getInternalChunk in interface IAuralModule

getExternalChunk

public IChunk getExternalChunk()
Specified by:
getExternalChunk in interface IAuralModule

getRecodeTime

public double getRecodeTime(IChunkType chunkType)

setRecodeTime

public void setRecodeTime(IChunkType chunkType,
                          double time)

getAuralDecayTime

public double getAuralDecayTime()
Description copied from interface: IAuralModule
how long does a sound take to decay out of the audicon

Specified by:
getAuralDecayTime in interface IAuralModule
Returns:
See Also:
IAuralModule.getAuralDecayTime()

setAuralDecayTime

public void setAuralDecayTime(double time)
Specified by:
setAuralDecayTime in interface IAuralModule
See Also:
IAuralModule.setAuralDecayTime(double)

getSetableParameters

public java.util.Collection<java.lang.String> getSetableParameters()
Description copied from interface: IParameterized
Return list of all parameters that can be set.

Specified by:
getSetableParameters in interface IParameterized
Overrides:
getSetableParameters in class AbstractAsynchronousModule
Returns:
The setableParameters value

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Description copied from interface: IParameterized
Set the named parameter

Specified by:
setParameter in interface IParameterized
Overrides:
setParameter in class AbstractAsynchronousModule

getParameter

public java.lang.String getParameter(java.lang.String key)
Description copied from interface: IParameterized
return parameter value - null if not defined.

Specified by:
getParameter in interface IParameterized
Overrides:
getParameter in class AbstractAsynchronousModule
Parameters:
key - Description of the Parameter
Returns:
The parameter value