public abstract class VisionLocalWorldView extends EventDrivenLocalWorldView implements IVisionLocalWorldView
IVisionLocalWorldView interface.AbstractLocalWorldView.LazyCompositeObjectMap<T extends ICompositeWorldObject>| Modifier and Type | Field and Description |
|---|---|
protected Map<TimeKey,Map<Class,Map<WorldObjectId,IViewable>>> |
syncVisibleClassMap
Synchronized version of visible objects sorted according to class.
|
protected Map<TimeKey,Map<WorldObjectId,IViewable>> |
syncVisibleMap
Synchronized version of visible objects.
|
protected Map<TimeKey,Map<Class,Map<WorldObjectId,IViewable>>> |
visibleClassMap
Map of all currently visible objects, sorted according to their classes.
|
protected Map<TimeKey,Map<WorldObjectId,IViewable>> |
visibleMap
Map of all currently visible objects.
|
notifyEventsList, receiveEventProcessing, WORLDVIEW_DEPENDENCYactLocalWorldObjects, agentId, classMap, COMPONENT_ID, control, controller, eventBus, log, sharedWorldView, syncClassMap| Constructor and Description |
|---|
VisionLocalWorldView(ComponentDependencies dependencies,
ILifecycleBus bus,
IAgentLogger logger,
ISharedWorldView parentWorldView,
ITeamedAgentId agentId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addVisible(ILocalViewable obj,
long time)
Adds the provided object as visible into all visibleMaps int the worldView.
|
Map<Class,Map<WorldObjectId,IViewable>> |
getAllVisible()
Returns map of all visible objects (
IViewable instances} - those that the agent can currently see. |
<T extends IViewable> |
getAllVisible(Class<T> type)
Returns map of all visible objects (
IViewable instances} - those that the agent can currently see. |
Map<WorldObjectId,IViewable> |
getVisible()
Returns map of all visible objects (
IViewable instances} organized according to their WorldObjectId -
those that the agent can currently see. |
IViewable |
getVisible(WorldObjectId id)
Returns a visible world object of the specific id (if exists inside the world view and is visible).
|
void |
notify(IWorldChangeEvent event)
New event was generated from the world.
|
protected void |
objectAppeared(ILocalViewable obj,
long time)
Handles events for making the object visible.
|
protected void |
objectCreated(ILocalWorldObject obj,
long time)
Must be called whenever an object was created, raises correct events.
|
protected void |
objectDestroyed(ILocalWorldObject obj,
long time)
Must be called whenever an object was destroyed - raises correct events.
|
protected void |
objectDisappeared(ILocalViewable obj,
long time)
Handles events for making the object not visible.
|
protected void |
objectUpdatedEvent(ILocalWorldObjectUpdatedEvent updateEvent)
Called from
EventDrivenWorldView.innerNotify(IWorldChangeEvent) if the event is IWorldObjectUpdatedEvent
to process it. |
protected void |
removeVisible(ILocalViewable obj,
long time)
Removes object of the same objectId as the provided localObject from visible maps.
|
innerNotify, notifyAfterPropagation, notifyImmediately, objectUpdated, raiseEventaddEventListener, addLocalWorldObject, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addOldLocalWorldObject, cleanUp, createCompositeObject, get, 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, unlockTimeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, get, getAgentId, getAll, getAll, getCurrentTimeKey, getEventBus, getLocal, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, lockTime, notifyImmediately, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, setCurrentTime, setInitialTime, unlockTimenotifyAfterPropagationgetComponentIdprotected Map<TimeKey,Map<WorldObjectId,IViewable>> visibleMap
protected Map<TimeKey,Map<WorldObjectId,IViewable>> syncVisibleMap
protected Map<TimeKey,Map<Class,Map<WorldObjectId,IViewable>>> visibleClassMap
public VisionLocalWorldView(ComponentDependencies dependencies, ILifecycleBus bus, IAgentLogger logger, ISharedWorldView parentWorldView, ITeamedAgentId agentId)
public void notify(IWorldChangeEvent event)
IWorldChangeEventInputnotify in interface IWorldChangeEventInputnotify in class EventDrivenLocalWorldViewprotected void objectUpdatedEvent(ILocalWorldObjectUpdatedEvent updateEvent)
EventDrivenLocalWorldViewEventDrivenWorldView.innerNotify(IWorldChangeEvent) if the event is IWorldObjectUpdatedEvent
to process it.objectUpdatedEvent in class EventDrivenLocalWorldViewprotected void objectCreated(ILocalWorldObject obj, long time)
EventDrivenLocalWorldViewMight be overridden to provide different behavior.
objectCreated in class EventDrivenLocalWorldViewprotected void objectDestroyed(ILocalWorldObject obj, long time)
EventDrivenLocalWorldViewMight be overriden to provide different behavior.
objectDestroyed in class EventDrivenLocalWorldViewprotected void objectAppeared(ILocalViewable obj, long time)
obj - protected void objectDisappeared(ILocalViewable obj, long time)
obj - protected void addVisible(ILocalViewable obj, long time)
obj - protected void removeVisible(ILocalViewable obj, long time)
obj - public Map<Class,Map<WorldObjectId,IViewable>> getAllVisible()
IVisionLocalWorldViewIViewable instances} - those that the agent can currently see.
WARNING: If you will do iteration over the map, you must synchronize on it.
getAllVisible in interface IVisionLocalWorldViewpublic <T extends IViewable> Map<WorldObjectId,T> getAllVisible(Class<T> type)
IVisionLocalWorldViewIViewable instances} - those that the agent can currently see.
WARNING: If you will do iteration over the map, you must synchronize on it.
getAllVisible in interface IVisionLocalWorldViewpublic Map<WorldObjectId,IViewable> getVisible()
IVisionLocalWorldViewIViewable instances} organized according to their WorldObjectId -
those that the agent can currently see.
WARNING: If you will do iteration over the map, you must synchronize on it.
getVisible in interface IVisionLocalWorldViewpublic IViewable getVisible(WorldObjectId id)
IVisionLocalWorldViewOtherwise, null is returned.
getVisible in interface IVisionLocalWorldViewid - objects's idCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.