cz.cuni.amis.pogamut.multi.communication.worldview.impl
Class BatchAwareLocalWorldView
java.lang.Object
cz.cuni.amis.pogamut.multi.communication.worldview.impl.AbstractLocalWorldView
cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView
cz.cuni.amis.pogamut.multi.communication.worldview.impl.VisionLocalWorldView
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
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.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 |
BatchAwareLocalWorldView
public BatchAwareLocalWorldView(ComponentDependencies dependencies,
ILifecycleBus bus,
IAgentLogger logger,
ISharedWorldView parentWorldView,
ITeamedAgentId agentId)
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