|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.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 java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IViewable>> |
syncVisibleClassMap
Synchronized version of visible objects sorted according to class. |
protected java.util.Map<WorldObjectId,IViewable> |
syncVisibleMap
Synchronized version of visible objects. |
protected java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IViewable>> |
visibleClassMap
Map of all currently visible objects, sorted according to their classes. |
protected AbstractLocalWorldView.LazyCompositeObjectMap<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)
Adds the provided object as visible into all visibleMaps int the worldView. |
|
java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IViewable>> |
getAllVisible()
Returns map of all visible objects ( IViewable instances} - those that the agent can currently see. |
|
|
getAllVisible(java.lang.Class<T> type)
Returns map of all visible objects ( IViewable instances} - those that the agent can currently see. |
|
java.util.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)
|
|
protected void |
objectAppeared(ILocalViewable obj)
Handles events for making the object visible. |
|
void |
objectCreated(ILocalWorldObject obj)
Must be called whenever an object was created, raises correct events. |
|
void |
objectDestroyed(ILocalWorldObject obj)
Must be called whenever an object was destroyed - raises correct events. |
|
protected void |
objectDisappeared(ILocalViewable obj)
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)
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, 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 |
Field Detail |
---|
protected AbstractLocalWorldView.LazyCompositeObjectMap<IViewable> visibleMap
protected java.util.Map<WorldObjectId,IViewable> syncVisibleMap
protected java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IViewable>> visibleClassMap
protected java.util.Map<java.lang.Class,java.util.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)
notify
in interface ITimedWorldChangeEventInput
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
public void objectCreated(ILocalWorldObject obj)
EventDrivenLocalWorldView
Might be overridden to provide different behavior.
objectCreated
in class EventDrivenLocalWorldView
public void objectDestroyed(ILocalWorldObject obj)
EventDrivenLocalWorldView
Might be overriden to provide different behavior.
objectDestroyed
in class EventDrivenLocalWorldView
protected void objectAppeared(ILocalViewable obj)
obj
- protected void objectDisappeared(ILocalViewable obj)
obj
- protected void addVisible(ILocalViewable obj)
obj
- protected void removeVisible(ILocalViewable obj)
obj
- public java.util.Map<java.lang.Class,java.util.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> java.util.Map<WorldObjectId,T> getAllVisible(java.lang.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 java.util.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 |