cz.cuni.amis.pogamut.multi.communication.worldview.impl
Class BatchAwareLocalWorldView

java.lang.Object
  extended by cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
      extended by cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView
          extended by cz.cuni.amis.pogamut.multi.communication.worldview.impl.VisionLocalWorldView
              extended by cz.cuni.amis.pogamut.multi.communication.worldview.impl.BatchAwareLocalWorldView
All Implemented Interfaces:
IComponent, ILocalWorldView, ITimedWorldChangeEventInput, IVisionLocalWorldView
Direct Known Subclasses:
UT2004VisionLocalWorldView

public abstract class BatchAwareLocalWorldView
extends VisionLocalWorldView


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
AbstractLocalWorldView.LazyCompositeObjectMap<T extends ICompositeWorldObject>
 
Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.VisionLocalWorldView
syncVisibleClassMap, syncVisibleMap, visibleClassMap, visibleMap
 
Fields inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView
notifyEventsList, receiveEventProcessing, WORLDVIEW_DEPENDENCY
 
Fields inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
actLocalWorldObjects, agentId, classMap, COMPONENT_ID, control, controller, eventBus, log, sharedWorldView, syncClassMap
 
Constructor Summary
BatchAwareLocalWorldView(ComponentDependencies dependencies, ILifecycleBus bus, IAgentLogger logger, ISharedWorldView parentWorldView, ITeamedAgentId agentId)
           
 
Method Summary
protected abstract  boolean isBatchBeginEvent(IWorldChangeEvent event)
           
protected abstract  boolean isBatchEndEvent(IWorldChangeEvent event)
           
 void lock()
          Must be called before starting logic.
 void notify(IWorldChangeEvent event)
           
protected  void notifySharedBegin(long time)
          Notifies sharedWorldView that a beginEvent has been recieved with with the specified time and the sharedWorldView should notify this worldView back, when all events for the time have been processed.
protected  void sharedBatchFinished(long time)
          This method is called when the SharedBatchFinishedEvent is recieved from the sharedWorldView, notifying us that all sharedEvents for the specified time have been processed and it is safe to run logic on the time.
 void unlock()
          Called after the logic has finished.
 
Methods inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.VisionLocalWorldView
addVisible, getAllVisible, getAllVisible, getVisible, getVisible, objectAppeared, objectCreated, objectDestroyed, objectDisappeared, objectUpdatedEvent, removeVisible
 
Methods inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView
innerNotify, objectUpdated, raiseEvent
 
Methods inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
addEventListener, addLocalWorldObject, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addOldLocalWorldObject, cleanUp, createCompositeObject, get, get, get, get, getAgentId, getAll, getAll, getAll, getAll, getComponentId, getCurrentTimeKey, getEventBus, getLocal, getLocal, getMostRecentLocalWorldObject, getSingle, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, lockTime, pause, prePause, preStop, removeEventListener, removeListener, removeLocalWorldObject, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, reset, resume, setCurrentTime, setInitialTime, start, stop, unlockTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.ILocalWorldView
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, getAgentId, getAll, getAll, getCurrentTimeKey, getEventBus, getLocal, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, lockTime, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, setCurrentTime, setInitialTime, unlockTime
 
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent
getComponentId
 

Constructor Detail

BatchAwareLocalWorldView

public BatchAwareLocalWorldView(ComponentDependencies dependencies,
                                ILifecycleBus bus,
                                IAgentLogger logger,
                                ISharedWorldView parentWorldView,
                                ITeamedAgentId agentId)
Method Detail

isBatchBeginEvent

protected abstract boolean isBatchBeginEvent(IWorldChangeEvent event)

isBatchEndEvent

protected abstract boolean isBatchEndEvent(IWorldChangeEvent event)

notifySharedBegin

protected void notifySharedBegin(long time)
Notifies sharedWorldView that a beginEvent has been recieved with with the specified time and the sharedWorldView should notify this worldView back, when all events for the time have been processed.

Parameters:
time -

sharedBatchFinished

protected void sharedBatchFinished(long time)
This method is called when the SharedBatchFinishedEvent is recieved from the sharedWorldView, notifying us that all sharedEvents for the specified time have been processed and it is safe to run logic on the time.

Parameters:
time -

lock

public void lock()
Must be called before starting logic.


unlock

public void unlock()
Called after the logic has finished.


notify

public void notify(IWorldChangeEvent event)
Specified by:
notify in interface ITimedWorldChangeEventInput
Overrides:
notify in class VisionLocalWorldView