|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView
cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView
cz.cuni.amis.pogamut.base3d.worldview.impl.VisionWorldView
public class VisionWorldView
Field Summary | |
---|---|
static java.lang.String |
WORLDVIEW_DEPENDENCY
|
Fields inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView |
---|
notifyEventsList, receiveEventProcessing |
Fields inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView |
---|
COMPONENT_ID, control, controller, eventBus, log |
Constructor Summary | |
---|---|
VisionWorldView(ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger log)
|
Method Summary | ||
---|---|---|
protected void |
addVisibleObject(IViewable worldObject)
Method that adds a world object to the visible object maps. |
|
protected void |
cleanUp()
Cleans up internal data structures, called from start/stop/kill/reset methods. |
|
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). |
|
protected void |
objectAppeared(IViewable obj)
Called whenever the object appears in the agent's FOV. |
|
protected void |
objectCreated(IWorldObject obj)
Additionally, it provides handling of IViewable objects raising WorldObjectAppearedEvent automatically (if object is visible). |
|
protected void |
objectDestroyed(IWorldObject obj)
Additionally it handles IViewable objects automatically raising WorldObjectDisappearedEvent if object was visible
before it was destroyed. |
|
protected void |
objectDisappeared(IViewable obj)
Called whenever the object disappears from the agent's FOV. |
|
protected void |
objectUpdatedEvent(IWorldObjectUpdatedEvent updateEvent)
It additionally handles IViewable objects automatically raising WorldObjectAppearedEvent and
WorldObjectDisappearedEvent . |
|
protected void |
removeVisibleObject(IViewable worldObject)
Removes world object from the visible world maps. |
Methods inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.EventDrivenWorldView |
---|
innerNotify, notify, notifyImmediately, objectUpdated, raiseEvent |
Methods inherited from class cz.cuni.amis.pogamut.base.communication.worldview.impl.AbstractWorldView |
---|
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addWorldObject, get, get, getAll, getAll, getComponentId, getEventBus, getLog, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, pause, prePause, preStop, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, removeWorldObject, reset, resume, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldView |
---|
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, getAll, getAll, getEventBus, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener |
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.worldview.IWorldChangeEventInput |
---|
notify, notifyImmediately |
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent |
---|
getComponentId |
Field Detail |
---|
public static final java.lang.String WORLDVIEW_DEPENDENCY
Constructor Detail |
---|
public VisionWorldView(ComponentDependencies dependencies, IComponentBus bus, IAgentLogger log)
Method Detail |
---|
protected void cleanUp()
AbstractWorldView
If you override this method, do not forget to call super.cleanUp().
cleanUp
in class AbstractWorldView
public java.util.Map<java.lang.Class,java.util.Map<WorldObjectId,IViewable>> getAllVisible()
IVisionWorldView
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 IVisionWorldView
public <T extends IViewable> java.util.Map<WorldObjectId,T> getAllVisible(java.lang.Class<T> type)
IVisionWorldView
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 IVisionWorldView
public java.util.Map<WorldObjectId,IViewable> getVisible()
IVisionWorldView
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 IVisionWorldView
public IViewable getVisible(WorldObjectId id)
IVisionWorldView
Otherwise, null is returned.
getVisible
in interface IVisionWorldView
id
- objects's id
protected void addVisibleObject(IViewable worldObject)
Synchronized!
worldObject
- protected void removeVisibleObject(IViewable worldObject)
Synchronized!
worldObject
- protected void objectUpdatedEvent(IWorldObjectUpdatedEvent updateEvent)
IViewable
objects automatically raising WorldObjectAppearedEvent
and
WorldObjectDisappearedEvent
.
objectUpdatedEvent
in class EventDrivenWorldView
protected void objectCreated(IWorldObject obj)
IViewable
objects raising WorldObjectAppearedEvent
automatically (if object is visible).
objectCreated
in class EventDrivenWorldView
protected void objectAppeared(IViewable obj)
obj
- protected void objectDisappeared(IViewable obj)
obj
- protected void objectDestroyed(IWorldObject obj)
IViewable
objects automatically raising WorldObjectDisappearedEvent
if object was visible
before it was destroyed.
objectDestroyed
in class EventDrivenWorldView
obj
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |