public class DefaultRetrievalModule6 extends AbstractModule implements IRetrievalModule4, IParameterized
http://jactr.org/node/33
Modifier and Type | Field and Description |
---|---|
protected static ChunkActivationComparator |
_activationSorter |
static java.lang.String |
ACCESSIBILITY_SLOT |
static java.lang.String |
INDEXED_RETRIEVAL_SLOT |
static java.lang.String |
INDEXED_RETRIEVALS_ENABLED_PARAM |
static java.lang.String |
PARTIAL_MATCH_SLOT |
static java.lang.String |
RECENTLY_RETRIEVED_SLOT |
static java.lang.String |
RETRIEVAL_THRESHOLD_SLOT |
static java.lang.String |
RETRIEVAL_TIME_SLOT |
LATENCY_EXPONENT, LATENCY_FACTOR
RETRIEVAL_THRESHOLD
Modifier | Constructor and Description |
---|---|
|
DefaultRetrievalModule6() |
protected |
DefaultRetrievalModule6(java.lang.String moduleName) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IRetrievalModuleListener listener,
java.util.concurrent.Executor executor) |
protected java.util.Collection<IActivationBuffer> |
createBuffers()
called to create any buffers used by this buffer.
|
void |
dispose()
release any resources.
|
protected void |
fireCompleted(ChunkTypeRequest pattern,
IChunk chunk,
double retrievalTime) |
protected void |
fireInitiated(ChunkTypeRequest pattern) |
double |
getLatencyExponent() |
double |
getLatencyFactor() |
java.lang.String |
getParameter(java.lang.String key)
return parameter value - null if not defined.
|
java.util.Collection<java.lang.String> |
getPossibleParameters()
Return all parameters that can be read
|
double |
getRetrievalThreshold() |
IRetrievalTimeEquation |
getRetrievalTimeEquation() |
java.util.Collection<java.lang.String> |
getSetableParameters()
Return list of all parameters that can be set.
|
boolean |
hasBeenRetrieved(IChunk chunk) |
void |
initialize()
this will be called after all the modules have been installed permitting
the module to attach listeners to other modules.
|
boolean |
isIndexedRetrievalEnabled() |
void |
removeListener(IRetrievalModuleListener listener) |
void |
reset()
reset the module.
|
void |
reset(boolean resetFinsts) |
java.util.concurrent.CompletableFuture<IChunk> |
retrieveChunk(ChunkTypeRequest chunkPattern) |
protected IChunk |
retrieveChunkInternal(IDeclarativeModule dm,
ChunkTypeRequest pattern) |
protected IChunk |
selectRetrieval(java.util.Collection<IChunk> results,
IChunk errorChunk,
ChunkTypeRequest originalRequest,
ChunkTypeRequest cleanedRequest)
choose the best matching result from the colleciton
|
void |
setIndexedRetrievalEnabled(boolean enabled) |
void |
setLatencyExponent(double exp) |
void |
setLatencyFactor(double fact) |
void |
setParameter(java.lang.String key,
java.lang.String value)
Set the named parameter
|
void |
setRetrievalThreshold(double threshold) |
delayedFuture, delayedFuture, getExecutor, getModel, getName, getSafeName, immediateFuture, immediateReturn, install, setExecutor, uninstall
addAdapterFactory, getAdapter, removeAdapterFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
uninstall
getAdapter
public static final java.lang.String INDEXED_RETRIEVALS_ENABLED_PARAM
public static final java.lang.String RECENTLY_RETRIEVED_SLOT
public static final java.lang.String RETRIEVAL_THRESHOLD_SLOT
public static final java.lang.String PARTIAL_MATCH_SLOT
public static final java.lang.String ACCESSIBILITY_SLOT
public static final java.lang.String RETRIEVAL_TIME_SLOT
public static final java.lang.String INDEXED_RETRIEVAL_SLOT
protected static final ChunkActivationComparator _activationSorter
public DefaultRetrievalModule6()
protected DefaultRetrievalModule6(java.lang.String moduleName)
public void dispose()
IModule
dispose
in interface IModule
dispose
in class AbstractModule
protected java.util.Collection<IActivationBuffer> createBuffers()
AbstractModule
createBuffers
in class AbstractModule
public boolean hasBeenRetrieved(IChunk chunk)
public boolean isIndexedRetrievalEnabled()
public void setIndexedRetrievalEnabled(boolean enabled)
public double getRetrievalThreshold()
getRetrievalThreshold
in interface IRetrievalModule
protected IChunk retrieveChunkInternal(IDeclarativeModule dm, ChunkTypeRequest pattern) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
protected IChunk selectRetrieval(java.util.Collection<IChunk> results, IChunk errorChunk, ChunkTypeRequest originalRequest, ChunkTypeRequest cleanedRequest)
results
- errorChunk
- originalRequest
- public java.util.concurrent.CompletableFuture<IChunk> retrieveChunk(ChunkTypeRequest chunkPattern)
retrieveChunk
in interface IRetrievalModule
public void setRetrievalThreshold(double threshold)
setRetrievalThreshold
in interface IRetrievalModule
protected void fireInitiated(ChunkTypeRequest pattern)
protected void fireCompleted(ChunkTypeRequest pattern, IChunk chunk, double retrievalTime)
public void addListener(IRetrievalModuleListener listener, java.util.concurrent.Executor executor)
addListener
in interface IRetrievalModule
public void removeListener(IRetrievalModuleListener listener)
removeListener
in interface IRetrievalModule
public void initialize()
IModule
initialize
in interface IModule
initialize
in interface IInitializable
initialize
in class AbstractModule
public IRetrievalTimeEquation getRetrievalTimeEquation()
getRetrievalTimeEquation
in interface IRetrievalModule
public double getLatencyExponent()
getLatencyExponent
in interface IRetrievalModule4
public double getLatencyFactor()
getLatencyFactor
in interface IRetrievalModule4
public void setLatencyExponent(double exp)
setLatencyExponent
in interface IRetrievalModule4
public void setLatencyFactor(double fact)
setLatencyFactor
in interface IRetrievalModule4
public java.lang.String getParameter(java.lang.String key)
IParameterized
getParameter
in interface IParameterized
key
- Description of the ParameterIParameterized.getParameter(java.lang.String)
public java.util.Collection<java.lang.String> getPossibleParameters()
IParameterized
getPossibleParameters
in interface IParameterized
IParameterized.getPossibleParameters()
public java.util.Collection<java.lang.String> getSetableParameters()
IParameterized
getSetableParameters
in interface IParameterized
IParameterized.getSetableParameters()
public void setParameter(java.lang.String key, java.lang.String value)
IParameterized
setParameter
in interface IParameterized
IParameterized.setParameter(java.lang.String,
java.lang.String)
public void reset()
IModule
public void reset(boolean resetFinsts)
reset
in interface IRetrievalModule