|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot>
cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavPoints
public class NavPoints
Memory module specialized on getting NavPoint
s from the IWorldView
.
All NavPoint
objects returned by this memory module are always self-updating
throughout the time, until the associated navPoint leaves the game. This means
that once a valid NavPoint object is obtained, it is not necessary to call any
methods of this memory module to get the object's info updated (e.g. navpoint's
location, visibility, reachability, etc.). The object will autoupdate itself.
The same principle is applied to all Maps returned by this memory module. Each returned Map is self-updating throughout the time. Once a specific Map is obtained (e.g. a map of visible enemies) from this memory module, the Map will get updated based on actions of the navPoints (e.g. joining or leaving the game, changing their team, moving around the map, etc.) automatically.
Note: All Maps returned by this memory module are locked and can not be modified outside this memory module. If you need to modify a Map returned by this module (for your own specific purpose), create a duplicate first. Such duplicates, however and of course, will not get updated.
WARNING:It is totally unclear what UT2004 means by reachable!!!
It is designed to be initialized inside IUT2004BotController.prepareBot(UT2004Bot)
method call
and may be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)
is called.
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
---|
worldView |
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
agent, controller, eventBus, log |
Constructor Summary | |
---|---|
NavPoints(UT2004Bot bot)
Constructor. |
|
NavPoints(UT2004Bot bot,
Logger log)
Constructor. |
Method Summary | |
---|---|
boolean |
canSeeNavPoints()
Tells, whether the agent sees any other navPoints. |
protected void |
cleanUp()
|
NavPoint |
getNavPoint(UnrealId UnrealId)
Retreives last known info about given navPoint. |
Map<UnrealId,NavPoint> |
getNavPoints()
Retreives a Map of all navPoints. |
NavPoint |
getNearestVisibleNavPoint()
Returns nearest-visible navPoint - if no if no navPoint is visible returns null. |
NavPoint |
getNearestVisibleNavPoint(Collection<NavPoint> navPoints)
Returns nearest-visible navPoint to the bot from the collection of 'navPoints' - if no navPoint is visible returns null. |
NavPoint |
getRandomVisibleNavPoint()
Returns random visible navPoint - if no if no navPoint is visible returns null. |
NavPoint |
getRecentlyVisibleNavPoint(double recently)
Returns nearest navPoint that is visible or that was 'recently' visible. |
NavPoint |
getVisibleNavPoint(UnrealId UnrealId)
Retrieves info about given navPoint, but only it the navPoint is visible. |
Map<UnrealId,NavPoint> |
getVisibleNavPoints()
Retrieves a Map of all visible navPoints. |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NavPoints(UT2004Bot bot)
bot
- owner of the module that is using itpublic NavPoints(UT2004Bot bot, Logger log)
bot
- owner of the module that is using itlog
- Logger to be used for logging runtime/debug info. If null, module creates its own logger.Method Detail |
---|
public NavPoint getNavPoint(UnrealId UnrealId)
Note: The returned NavPoint object is self updating throughout time. Once you have a valid NavPoint object, you do not have to call this method to get updated info about that navPoint.
UnrealId
- NavPoint UnrealId to be retreived.
getVisibleNavPoint(UnrealId)
,
getReachableNavPoint(UnrealId)
public NavPoint getVisibleNavPoint(UnrealId UnrealId)
Note: The returned NavPoint object is self updating throughout time. Once you have a valid NavPoint object, you do not have to call this method to get updated info about visibility of that navPoint.
UnrealId
- NavPoint UnrealId to be retrieved.
getNavPoint(UnrealId)
,
getReachableNavPoint(UnrealId)
public Map<UnrealId,NavPoint> getNavPoints()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of navPoints from this memory module, the Map will get updated based on actions of the navPoints (e.g. joining or leaving the game, changing their status, etc.).
getEnemies()
,
getFriends()
,
getVisibleNavPoints()
,
getReachableNavPoints()
public Map<UnrealId,NavPoint> getVisibleNavPoints()
Note: The returned Map is unmodifiable and self updating throughout time. Once you obtain a specific Map of navPoints from this memory module, the Map will get updated based on actions of the navPoints (e.g. joining or leaving the game, or changing their visibility, etc.).
getNavPoints()
,
getVisibleEnemies()
,
getVisibleFriends()
,
canSeeNavPoints()
public NavPoint getRecentlyVisibleNavPoint(double recently)
recently
- how long the navPoint may be non-visible. IN MILISECONDS!
public NavPoint getNearestVisibleNavPoint()
public NavPoint getNearestVisibleNavPoint(Collection<NavPoint> navPoints)
navPoints
- collection to go through
public NavPoint getRandomVisibleNavPoint()
public boolean canSeeNavPoints()
getVisibleNavPoints()
protected void cleanUp()
cleanUp
in class AgentModule<UT2004Bot>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |