|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public abstract class VisionLocalWorldView
VisionLocalWorldView manages information about all objects currently in the bot's FOV (field-of-view)
by implementing methods from IVisionLocalWorldView
interface.
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 | |
---|---|
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. |
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 | |
---|---|
VisionLocalWorldView(ComponentDependencies dependencies,
ILifecycleBus bus,
IAgentLogger logger,
ISharedWorldView parentWorldView,
ITeamedAgentId agentId)
|
Method Summary | ||
---|---|---|
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. |
|
|
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. |
Methods inherited from class cz.cuni.amis.pogamut.multi.communication.worldview.impl.EventDrivenLocalWorldView |
---|
innerNotify, notifyAfterPropagation, notifyImmediately, 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, 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, get, getAgentId, getAll, getAll, getCurrentTimeKey, getEventBus, getLocal, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, lockTime, notifyImmediately, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, setCurrentTime, setInitialTime, unlockTime |
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldChangeEventInput |
---|
notifyAfterPropagation |
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent |
---|
getComponentId |
Field Detail |
---|
protected Map<TimeKey,Map<WorldObjectId,IViewable>> visibleMap
protected Map<TimeKey,Map<WorldObjectId,IViewable>> syncVisibleMap
protected Map<TimeKey,Map<Class,Map<WorldObjectId,IViewable>>> visibleClassMap
protected Map<TimeKey,Map<Class,Map<WorldObjectId,IViewable>>> syncVisibleClassMap
Constructor Detail |
---|
public VisionLocalWorldView(ComponentDependencies dependencies, ILifecycleBus bus, IAgentLogger logger, ISharedWorldView parentWorldView, ITeamedAgentId agentId)
Method Detail |
---|
public void notify(IWorldChangeEvent event)
IWorldChangeEventInput
notify
in interface IWorldChangeEventInput
notify
in class EventDrivenLocalWorldView
protected void objectUpdatedEvent(ILocalWorldObjectUpdatedEvent updateEvent)
EventDrivenLocalWorldView
EventDrivenWorldView.innerNotify(IWorldChangeEvent)
if the event is IWorldObjectUpdatedEvent
to process it.
objectUpdatedEvent
in class EventDrivenLocalWorldView
protected void objectCreated(ILocalWorldObject obj, long time)
EventDrivenLocalWorldView
Might be overridden to provide different behavior.
objectCreated
in class EventDrivenLocalWorldView
protected void objectDestroyed(ILocalWorldObject obj, long time)
EventDrivenLocalWorldView
Might be overriden to provide different behavior.
objectDestroyed
in class EventDrivenLocalWorldView
protected 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()
IVisionLocalWorldView
IViewable
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 IVisionLocalWorldView
public <T extends IViewable> Map<WorldObjectId,T> getAllVisible(Class<T> type)
IVisionLocalWorldView
IViewable
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 IVisionLocalWorldView
public Map<WorldObjectId,IViewable> getVisible()
IVisionLocalWorldView
IViewable
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 IVisionLocalWorldView
public IViewable getVisible(WorldObjectId id)
IVisionLocalWorldView
Otherwise, null is returned.
getVisible
in interface IVisionLocalWorldView
id
- objects's id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |