|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jactr.modules.pm.common.memory.map.DefaultFINSTFeatureMap
public class DefaultFINSTFeatureMap
FINST tracking feature map that is used by both the aural and visual modules.
Unlike all the other IFeatureMaps, this one is accessed by both the
common reality and model threads. As such, it is necessary to use a
ReentrantReadWriteLock to protect the data. Commonreality accesses
this feature map (like all the other feature maps) through the
afferentObjectAdded(IAfferentObject),
afferentObjectRemoved(IAfferentObject),
afferentObjectUpdated(IAfferentObject, IObjectDelta) methods. The
model thread accesses it indirectly through the FlagAsOld timed event
which is posted by any call to
flagAsAttended(IIdentifier, IChunk, double),
flagAsNew(IIdentifier, IChunk, double), or
flagAsOld(IIdentifier, IChunk).
Without this thread synchronization, deadlock or concurrent modifications
would occur.
There is still much improvement that can be made in terms of the granularity
and speed, the current thread safety is course and rather slow. [the old,
unprotected version ran allowed models to run at 500x real time, this version
brings it down to 250x]
Note: this does not fire events
| Constructor Summary | |
|---|---|
DefaultFINSTFeatureMap(IModel model,
java.lang.String attendedSlotName)
|
|
| Method Summary | |
|---|---|
void |
addListener(IFeatureMapListener listener,
java.util.concurrent.Executor executor)
|
void |
afferentObjectAdded(org.commonreality.object.IAfferentObject object)
|
void |
afferentObjectRemoved(org.commonreality.object.IAfferentObject object)
|
void |
afferentObjectUpdated(org.commonreality.object.IAfferentObject object,
org.commonreality.object.delta.IObjectDelta delta)
|
void |
clear()
|
void |
dispose()
|
void |
fillSlotValues(ChunkTypeRequest mutableRequest,
org.commonreality.identifier.IIdentifier identifier,
IChunk encodedChunk,
ChunkTypeRequest originalSearchRequest)
fill the slot values accordingly for this identifier at the mutablePattern location this is then used to further specify the actual location chunk that will be returned |
void |
flagAsAttended(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk,
double duration)
|
void |
flagAsNew(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk,
double duration)
|
void |
flagAsOld(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk)
|
void |
getAttended(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
|
void |
getCandidateRealObjects(ChunkTypeRequest request,
java.util.Set<org.commonreality.identifier.IIdentifier> container)
return all the identifiers of all possible objects that can exist at the visual location defined by this search pattern if nothing is available, and empty collection is to be returned |
FINSTState |
getInformation(org.commonreality.identifier.IIdentifier identifier)
returns the feature value for this object |
int |
getMaximumFINSTs()
|
void |
getNew(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
|
void |
getOld(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
|
IPerceptualMemory |
getPerceptualMemory()
|
boolean |
isAttended(org.commonreality.identifier.IIdentifier identifier)
|
boolean |
isInterestedIn(ChunkTypeRequest request)
|
boolean |
isInterestedIn(org.commonreality.object.IAfferentObject object)
|
boolean |
isNew(org.commonreality.identifier.IIdentifier identifier)
|
boolean |
isOld(org.commonreality.identifier.IIdentifier identifier)
|
void |
normalizeRequest(ChunkTypeRequest request)
provides an opportunity to normalize any varialbes. |
void |
removeListener(IFeatureMapListener listener)
|
void |
reset()
reset all the finsts |
void |
setMaximumFINSTs(int max)
|
void |
setPerceptualMemory(IPerceptualMemory memory)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFINSTFeatureMap(IModel model,
java.lang.String attendedSlotName)
| Method Detail |
|---|
public void addListener(IFeatureMapListener listener,
java.util.concurrent.Executor executor)
addListener in interface IFeatureMap<FINSTState>public void removeListener(IFeatureMapListener listener)
removeListener in interface IFeatureMap<FINSTState>public void setPerceptualMemory(IPerceptualMemory memory)
setPerceptualMemory in interface IFeatureMap<FINSTState>public IPerceptualMemory getPerceptualMemory()
getPerceptualMemory in interface IFeatureMap<FINSTState>public void getNew(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
getNew in interface IFINSTFeatureMaporg.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#getNew()public boolean isNew(org.commonreality.identifier.IIdentifier identifier)
isNew in interface IFINSTFeatureMappublic void getOld(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
getOld in interface IFINSTFeatureMappublic boolean isOld(org.commonreality.identifier.IIdentifier identifier)
isOld in interface IFINSTFeatureMappublic void getAttended(java.util.Set<org.commonreality.identifier.IIdentifier> destination)
getAttended in interface IFINSTFeatureMappublic boolean isAttended(org.commonreality.identifier.IIdentifier identifier)
isAttended in interface IFINSTFeatureMappublic int getMaximumFINSTs()
getMaximumFINSTs in interface IFINSTFeatureMappublic void setMaximumFINSTs(int max)
setMaximumFINSTs in interface IFINSTFeatureMap
public void flagAsAttended(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk,
double duration)
flagAsAttended in interface IFINSTFeatureMaporg.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#flagAsAttended(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)
public void flagAsNew(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk,
double duration)
flagAsNew in interface IFINSTFeatureMaporg.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#flagAsNew(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)
public void flagAsOld(org.commonreality.identifier.IIdentifier identifier,
IChunk chunk)
flagAsOld in interface IFINSTFeatureMapIFINSTFeatureMap.flagAsOld(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)public void reset()
IFINSTFeatureMap
reset in interface IFINSTFeatureMapIFINSTFeatureMap.reset()public void clear()
clear in interface IFeatureMap<FINSTState>IFeatureMap.clear()public void dispose()
dispose in interface IFeatureMap<FINSTState>IFeatureMap.dispose()
public void fillSlotValues(ChunkTypeRequest mutableRequest,
org.commonreality.identifier.IIdentifier identifier,
IChunk encodedChunk,
ChunkTypeRequest originalSearchRequest)
IFeatureMap
fillSlotValues in interface IFeatureMap<FINSTState>mutableRequest - the pseudo visual location to be setupencodedChunk - TODOIFeatureMap.fillSlotValues(ChunkTypeRequest,
org.commonreality.identifier.IIdentifier, IChunk, ChunkTypeRequest)public FINSTState getInformation(org.commonreality.identifier.IIdentifier identifier)
IFeatureMap
getInformation in interface IFeatureMap<FINSTState>
public void getCandidateRealObjects(ChunkTypeRequest request,
java.util.Set<org.commonreality.identifier.IIdentifier> container)
IFeatureMap
getCandidateRealObjects in interface IFeatureMap<FINSTState>IFeatureMap.getCandidateRealObjects(ChunkTypeRequest,
Set)public void afferentObjectAdded(org.commonreality.object.IAfferentObject object)
afferentObjectAdded in interface IAfferentObjectListenerIAfferentObjectListener.afferentObjectAdded(org.commonreality.object.IAfferentObject)public void afferentObjectRemoved(org.commonreality.object.IAfferentObject object)
afferentObjectRemoved in interface IAfferentObjectListenerIAfferentObjectListener.afferentObjectRemoved(org.commonreality.object.IAfferentObject)
public void afferentObjectUpdated(org.commonreality.object.IAfferentObject object,
org.commonreality.object.delta.IObjectDelta delta)
afferentObjectUpdated in interface IAfferentObjectListenerIAfferentObjectListener.afferentObjectUpdated(org.commonreality.object.IAfferentObject,
org.commonreality.object.delta.IObjectDelta)public boolean isInterestedIn(org.commonreality.object.IAfferentObject object)
isInterestedIn in interface IAfferentObjectListenerIAfferentObjectListener.isInterestedIn(org.commonreality.object.IAfferentObject)public boolean isInterestedIn(ChunkTypeRequest request)
isInterestedIn in interface IFeatureMap<FINSTState>public void normalizeRequest(ChunkTypeRequest request)
IFeatureMapIFeatureMap.isInterestedIn(ChunkTypeRequest)
normalizeRequest in interface IFeatureMap<FINSTState>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||