org.commonreality.sensors.base
Class PerceptManager

java.lang.Object
  extended by org.commonreality.sensors.base.PerceptManager

public class PerceptManager
extends java.lang.Object

the percept manager is tailored (primarily for afferent percepts) to create percepts for arbitrary programmatic objects. Objects marked as dirty in the PerceptManager are passed through the set of IObjectCreators, to find the set of possible percepts for the object. The IObjectCreator is responsible for creating the IObjectKey which tracks the percept-object linkage as well as the initial ISimulationObject (most likely a IAfferentObject).

The ISimulationObject and IObjectKey for that object is then passed through the set of IObjectProcessors which can add additional properties to the percept.

Once all of this is done, the percept manager signals the BaseSensor will all the additions and modifications( BaseSensor.add(Collection) and BaseSensor.update(Collection). Removals are handled by flagging flagForRemoval(Object) the object, which then delegates the actual clean up to the IObjectCreator and the BaseSensor

Author:
harrison

Constructor Summary
PerceptManager(BaseSensor sensor)
           
 
Method Summary
 void flagForRemoval(java.lang.Object object)
          flag this object as ready for removal
 void install(IObjectCreator creater)
           
 void install(IObjectProcessor processor)
           
 void markAsDirty(java.lang.Object object)
          call when an object is new or has changed.
 void processDirtyObjects()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerceptManager

public PerceptManager(BaseSensor sensor)
Method Detail

reset

public void reset()

install

public void install(IObjectCreator creater)

install

public void install(IObjectProcessor processor)

markAsDirty

public void markAsDirty(java.lang.Object object)
call when an object is new or has changed.

Parameters:
object -

flagForRemoval

public void flagForRemoval(java.lang.Object object)
flag this object as ready for removal

Parameters:
object -

processDirtyObjects

public void processDirtyObjects()