public class DefaultFINSTFeatureMap extends java.lang.Object implements IFINSTFeatureMap
IFeatureMap
s, 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)
.Modifier and Type | Class and Description |
---|---|
protected class |
DefaultFINSTFeatureMap.FINST |
Constructor and Description |
---|
DefaultFINSTFeatureMap(IModel model,
java.lang.String attendedSlotName) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IFeatureMapListener listener,
java.util.concurrent.Executor executor) |
void |
afferentObjectAdded(IAfferentObject object) |
void |
afferentObjectRemoved(IAfferentObject object) |
void |
afferentObjectUpdated(IAfferentObject object,
IObjectDelta delta) |
void |
clear() |
protected void |
dispatch(FeatureMapEvent event) |
void |
dispose() |
void |
fillSlotValues(ChunkTypeRequest mutableRequest,
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(IIdentifier identifier,
IChunk chunk,
double duration) |
void |
flagAsNew(IIdentifier identifier,
IChunk chunk,
double duration) |
void |
flagAsOld(IIdentifier identifier,
IChunk chunk) |
void |
getAttended(java.util.Set<IIdentifier> destination) |
void |
getCandidateRealObjects(ChunkTypeRequest request,
java.util.Set<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
|
protected DefaultFINSTFeatureMap.FINST |
getFINST(IIdentifier identifier) |
FINSTState |
getInformation(IIdentifier identifier)
returns the feature value for this object
|
int |
getMaximumFINSTs() |
void |
getNew(java.util.Set<IIdentifier> destination) |
void |
getOld(java.util.Set<IIdentifier> destination) |
IPerceptualMemory |
getPerceptualMemory() |
protected boolean |
hasListeners() |
boolean |
isAttended(IIdentifier identifier) |
boolean |
isInterestedIn(ChunkTypeRequest request) |
boolean |
isInterestedIn(IAfferentObject object) |
boolean |
isNew(IIdentifier identifier) |
boolean |
isOld(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) |
public DefaultFINSTFeatureMap(IModel model, java.lang.String attendedSlotName)
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>
protected boolean hasListeners()
protected void dispatch(FeatureMapEvent event)
public void setPerceptualMemory(IPerceptualMemory memory)
setPerceptualMemory
in interface IFeatureMap<FINSTState>
public IPerceptualMemory getPerceptualMemory()
getPerceptualMemory
in interface IFeatureMap<FINSTState>
public void getNew(java.util.Set<IIdentifier> destination)
getNew
in interface IFINSTFeatureMap
org.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#getNew()
public boolean isNew(IIdentifier identifier)
isNew
in interface IFINSTFeatureMap
public void getOld(java.util.Set<IIdentifier> destination)
getOld
in interface IFINSTFeatureMap
public boolean isOld(IIdentifier identifier)
isOld
in interface IFINSTFeatureMap
public void getAttended(java.util.Set<IIdentifier> destination)
getAttended
in interface IFINSTFeatureMap
public boolean isAttended(IIdentifier identifier)
isAttended
in interface IFINSTFeatureMap
protected DefaultFINSTFeatureMap.FINST getFINST(IIdentifier identifier)
public int getMaximumFINSTs()
getMaximumFINSTs
in interface IFINSTFeatureMap
public void setMaximumFINSTs(int max)
setMaximumFINSTs
in interface IFINSTFeatureMap
public void flagAsAttended(IIdentifier identifier, IChunk chunk, double duration)
flagAsAttended
in interface IFINSTFeatureMap
org.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#flagAsAttended(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)
public void flagAsNew(IIdentifier identifier, IChunk chunk, double duration)
flagAsNew
in interface IFINSTFeatureMap
org.jactr.modules.pm.common.memory.map.IFINSTFeatureMap#flagAsNew(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)
public void flagAsOld(IIdentifier identifier, IChunk chunk)
flagAsOld
in interface IFINSTFeatureMap
IFINSTFeatureMap.flagAsOld(org.commonreality.identifier.IIdentifier,
org.jactr.core.chunk.IChunk)
public void reset()
IFINSTFeatureMap
reset
in interface IFINSTFeatureMap
IFINSTFeatureMap.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, 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(IIdentifier identifier)
IFeatureMap
getInformation
in interface IFeatureMap<FINSTState>
public void getCandidateRealObjects(ChunkTypeRequest request, java.util.Set<IIdentifier> container)
IFeatureMap
getCandidateRealObjects
in interface IFeatureMap<FINSTState>
IFeatureMap.getCandidateRealObjects(ChunkTypeRequest,
Set)
public void afferentObjectAdded(IAfferentObject object)
afferentObjectAdded
in interface IAfferentObjectListener
IAfferentObjectListener.afferentObjectAdded(org.commonreality.object.IAfferentObject)
public void afferentObjectRemoved(IAfferentObject object)
afferentObjectRemoved
in interface IAfferentObjectListener
IAfferentObjectListener.afferentObjectRemoved(org.commonreality.object.IAfferentObject)
public void afferentObjectUpdated(IAfferentObject object, IObjectDelta delta)
public boolean isInterestedIn(IAfferentObject object)
isInterestedIn
in interface IAfferentObjectListener
IAfferentObjectListener.isInterestedIn(org.commonreality.object.IAfferentObject)
public boolean isInterestedIn(ChunkTypeRequest request)
isInterestedIn
in interface IFeatureMap<FINSTState>
public void normalizeRequest(ChunkTypeRequest request)
IFeatureMap
IFeatureMap.isInterestedIn(ChunkTypeRequest)
normalizeRequest
in interface IFeatureMap<FINSTState>