public class Visibility extends SensorModule<UT2004Bot>
VisibilityLocation
s for which we have VisibilityMatrix
built.
Note that the module expects "VisibilityMatrix-" + mapName + "-All.bin" file present
in the current directory of the process "." (preferred) or directory specified in PogamutUT2004.properties under
PogamutUT2004Property.POGAMUT_UT2004_VISIBILITY_DIRECTORY
. This file can be generated utilizing
VisibilityCreator
and its VisibilityCreator.main(String[])
method.worldView
agent, controller, eventBus, log
Constructor and Description |
---|
Visibility(UT2004Bot bot,
AgentInfo info)
Constructor.
|
Visibility(UT2004Bot bot,
AgentInfo info,
Logger log)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUp() |
Set<NavPoint> |
getCoverNavPointsFrom(ILocated loc)
Returns set of
NavPoint that are not visible from "loc". |
Set<NavPoint> |
getCoverNavPointsFromN(ILocated... enemies)
Returns set of
NavPoint that are not visible from any 'enemies'. |
Set<VisibilityLocation> |
getCoverPointsFrom(ILocated loc)
Returns set of
VisibilityLocation that are not visible from "loc". |
Set<VisibilityLocation> |
getCoverPointsFromN(ILocated... enemies)
Returns set of
VisibilityLocation that are not visible from any 'enemies'. |
Set<NavPoint> |
getHiddenNavPoints()
Returns set of
NavPoint that are not visible FROM CURRENT BOT LOCATION. |
Set<VisibilityLocation> |
getHiddenPoints()
Returns set of
VisibilityLocation that are not visible FROM BOT CURRENT LOCATION. |
VisibilityMatrix |
getMatrix()
Returns underlying
VisibilityMatrix that is neede for custom advanced computation. |
NavPoint |
getNearestCoverNavPointFrom(ILocated enemy)
Returns nearest cover
NavPoint for BOT where to hide from 'enemy'. |
NavPoint |
getNearestCoverNavPointFromN(ILocated target,
ILocated... enemies)
Returns nearest cover nav point for 'target' that is hidden from all 'enemies'.
|
NavPoint |
getNearestCoverNavPointN(ILocated... enemies)
Returns nearest cover nav point for BOT that is hidden from all 'enemies'.
|
VisibilityLocation |
getNearestCoverPointFrom(ILocated enemy)
Returns nearest cover point for BOT where to hide from 'enemy'.
|
VisibilityLocation |
getNearestCoverPointFromN(ILocated target,
ILocated... enemies)
Returns nearest cover point for 'target' that is hidden from all 'enemies'.
|
VisibilityLocation |
getNearestCoverPointN(ILocated... enemies)
Returns nearest cover point for BOT that is hidden from all 'enemies'.
|
NavPoint |
getNearestNavPointTo(ILocated located)
Nearest
NavPoint to 'located' present in the matrix, this should equal (== 99.99%) to nearest navpoint in the map. |
NavPoint |
getNearestNavPopint()
Nearest
NavPoint to BOT CURRENT LOCATION present in the matrix, this should equal (== 99.99%) to nearest navpoint (to bot) in the map. |
VisibilityLocation |
getNearestVisibilityLocation()
Nearest
VisibilityLocation to BOT CURRENT LOCATION. |
VisibilityLocation |
getNearestVisibilityLocationTo(ILocated located)
Nearest
VisibilityLocation to 'located' present in matrix. |
Set<NavPoint> |
getVisibleNavPoints()
Returns set of
NavPoint that are visible FROM CURRENT BOT LOCATION. |
Set<NavPoint> |
getVisibleNavPointsFrom(ILocated loc)
Returns set of
NavPoint that are visible from "loc". |
Set<VisibilityLocation> |
getVisiblePoints()
Returns set of
VisibilityLocation that are visible FROM CURRENT BOT LOCATION. |
Set<VisibilityLocation> |
getVisiblePointsFrom(ILocated loc)
Returns set of
VisibilityLocation that are visible from "loc". |
boolean |
isInitialized()
Tells you whether the module is initialized, e.g., visibility matrix information is available for the level.
|
boolean |
isVisible(ILocated target)
Returns whether BOT can see 'target' (and vice versa == symmetric info).
|
boolean |
isVisible(ILocated loc1,
ILocated loc2)
Returns whether 'loc1' is visible from 'loc2' (and vice versa == symmetric info).
|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
public Visibility(UT2004Bot bot, AgentInfo info)
bot
- owner of the module that is using itinfo
- AgentInfo
module to be usedpublic Visibility(UT2004Bot bot, AgentInfo info, Logger log)
bot
- owner of the module that is using itinfo
- AgentInfo
module to be usedlog
- Logger to be used for logging runtime/debug info. If null, the module creates its own logger.public boolean isInitialized()
VisibilityCreator
that contains VisibilityCreator.main(String[])
method implemented for quick generation
of VisibilityMatrix
that is used for obtaining all visibility information for the level.public VisibilityMatrix getMatrix()
VisibilityMatrix
that is neede for custom advanced computation.public VisibilityLocation getNearestVisibilityLocationTo(ILocated located)
VisibilityLocation
to 'located' present in matrix.
I.e., nearest VisibilityLocation
we're having visibility information for.located
- public VisibilityLocation getNearestVisibilityLocation()
VisibilityLocation
to BOT CURRENT LOCATION.
I.e., nearest VisibilityLocation
we're having visibility information for.public NavPoint getNearestNavPointTo(ILocated located)
NavPoint
to 'located' present in the matrix, this should equal (== 99.99%) to nearest navpoint in the map.located
- public NavPoint getNearestNavPopint()
NavPoint
to BOT CURRENT LOCATION present in the matrix, this should equal (== 99.99%) to nearest navpoint (to bot) in the map.public boolean isVisible(ILocated loc1, ILocated loc2)
VisibilityLocation
.
The information is accurate for navpoints and very accurate for points on links between navpoints.
If module is not isInitialized()
, returns false.loc1
- loc2
- public boolean isVisible(ILocated target)
VisibilityLocation
.
The information is accurate for navpoints and very accurate for points on links between navpoints.
If module is not isInitialized()
, returns false.target
- public Set<VisibilityLocation> getCoverPointsFrom(ILocated loc)
VisibilityLocation
that are not visible from "loc".loc
- public Set<VisibilityLocation> getHiddenPoints()
VisibilityLocation
that are not visible FROM BOT CURRENT LOCATION.public VisibilityLocation getNearestCoverPointFrom(ILocated enemy)
enemy
- public Set<VisibilityLocation> getVisiblePointsFrom(ILocated loc)
VisibilityLocation
that are visible from "loc".loc
- public Set<VisibilityLocation> getVisiblePoints()
VisibilityLocation
that are visible FROM CURRENT BOT LOCATION.public Set<NavPoint> getCoverNavPointsFrom(ILocated loc)
NavPoint
that are not visible from "loc".loc
- public Set<NavPoint> getHiddenNavPoints()
NavPoint
that are not visible FROM CURRENT BOT LOCATION.public NavPoint getNearestCoverNavPointFrom(ILocated enemy)
NavPoint
for BOT where to hide from 'enemy'.enemy
- public Set<NavPoint> getVisibleNavPointsFrom(ILocated loc)
NavPoint
that are visible from "loc".loc
- public Set<NavPoint> getVisibleNavPoints()
NavPoint
that are visible FROM CURRENT BOT LOCATION.public Set<VisibilityLocation> getCoverPointsFromN(ILocated... enemies)
VisibilityLocation
that are not visible from any 'enemies'.enemies
- public VisibilityLocation getNearestCoverPointFromN(ILocated target, ILocated... enemies)
target
- enemies
- public VisibilityLocation getNearestCoverPointN(ILocated... enemies)
target
- enemies
- public Set<NavPoint> getCoverNavPointsFromN(ILocated... enemies)
NavPoint
that are not visible from any 'enemies'.enemies
- public NavPoint getNearestCoverNavPointFromN(ILocated target, ILocated... enemies)
target
- enemies
- public NavPoint getNearestCoverNavPointN(ILocated... enemies)
enemies
- protected void cleanUp()
cleanUp
in class AgentModule<UT2004Bot>
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.