|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT> cz.cuni.amis.pogamut.base.agent.module.SensorModule<UDKBot> cz.cuni.amis.pogamut.udk.agent.module.sensor.Senses
public class Senses
Memory module specialized on agent's senses.
This module hooks up a LOT OF LISTENERS and provide you with lot of methods to query current state of bot's sensors.
There are two types of methods:
If you are missing some methods that you think should be incorporated to the module, post to Pogamut 3 forum and we may then discuss the implementation.
It is designed to be initialized inside IUDKBotController.prepareBot(UDKBot)
method call
and may be used since IUDKBotController.botInitialized(cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.GameInfo, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange, cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.InitedMessage)
is called.
Field Summary | |
---|---|
protected AgentInfo |
agentInfo
AgentInfo memory module. |
static double |
SENSE_THRESHOLD
Specifies amount of time after which the sense (event) is considered to be invalid/old/discarded. |
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 | |
---|---|
Senses(UDKBot bot)
Constructor. |
|
Senses(UDKBot bot,
AgentInfo agentInfo,
Players players)
Constructor. |
|
Senses(UDKBot bot,
AgentInfo agentInfo,
Players players,
Logger log)
Constructor. |
Method Summary | |
---|---|
BotKilled |
getBotDeath()
Provides information about the way this bot has died. |
Player |
getBumpingPlayer()
Returns tha Player object of the player the bot has bumped into (if it was a bot). |
Location |
getBumpLocation()
Returns location where bumping occurred. |
Location |
getCollisionLocation()
Tells where the agent has collided. |
javax.vecmath.Vector3d |
getCollisionNormal()
Tells the normal of last agent's collision. |
ItemPickedUp |
getItemPickedUp()
Provides information about the last item the bot has picked up. |
PlayerDamaged |
getLastCausedDamage()
Returns the description of the last damage caused by the bot. |
BotDamaged |
getLastDamage()
Returns the description of the last damage done to the bot. |
PlayerDamaged |
getLastHitPlayer()
Returns the description of the last hit of another player. |
IncomingProjectile |
getLastIncomingProjectile()
Provides access to the last incoming-projectile object. |
BotDamaged |
getLastShot()
Returns the description of the last shot that has hit the bot. |
Rotation |
getNoiseRotation()
Tells where the noise is coming from. |
UnrealId |
getNoiseSource()
Tells what has caused a noise (may be null). |
String |
getNoiseType()
Tells what type the noise is. |
Rotation |
getPickupNoiseRotation()
Tells where the pickup noise is coming from. |
UnrealId |
getPickupNoiseSource()
Tells what has caused the pickup noise (may be null). |
String |
getPickupNoiseType()
Tells what type the pickup noise is. |
PlayerKilled |
getPlayerKilled(Player player)
Returns detail information about the way the player has died. |
PlayerKilled |
getPlayerKilled(UnrealId playerId)
Returns detail information about the way the player of id 'playerId' has died. |
Double |
getTimeDelta()
Returns UT2004 time delta. |
boolean |
hasDied()
Tells whether this bot has recently died. |
boolean |
hasDiedOnce()
Tells whether this bot has recently died. |
boolean |
isAdrenalineGained()
Tells whether the bot has recently got an adrenaline. |
boolean |
isAdrenalineGainedOnce()
Tells whether the bot has recently got an adrenaline. |
boolean |
isBeingDamaged()
Tells, whether the agent is being damaged. |
boolean |
isBeingDamagedOnce()
Tells, whether the agent is being damaged. |
boolean |
isBumping()
Tells whether the bot is bumping another player/other map geometry. |
boolean |
isBumpingOnce()
Tells, whether the agent is bumping with another player/other map geometry. |
boolean |
isBumpingPlayer()
Tells whether the bot is bumping another player (bot or human). |
boolean |
isBumpingPlayerOnce()
Tells whether the bot is bumping another player (bot or human). |
boolean |
isCausingDamage()
Tells, whether the agent is causing any damage. |
boolean |
isCausingDamageOnce()
Tells, whether the agent is causing any damage. |
boolean |
isColliding()
Tells, whether the agent is colliding with map geometry. |
boolean |
isCollidingOnce()
Tells, whether the agent is colliding with map geometry. |
boolean |
isFallEdge()
Tells whether the bot has just fall of the ledge |
boolean |
isFallEdgeOnce()
Tells whether the bot has just fall of the ledge Note: This method clears the fall-edge flag upon invocation. |
boolean |
isHearingNoise()
Tells whether the bot is hearing noise. |
boolean |
isHearingNoiseOnce()
Tells whether the bot is hearing noise. |
boolean |
isHearingPickup()
Tells whether the bot is hearing pickup. |
boolean |
isHearingPickupOnce()
Tells whether the bot is hearing pickup. |
boolean |
isHitPlayer()
Tells, whether the agent hit another player (i.e.. shot it). |
boolean |
isHitPlayerOnce()
Tells, whether the agent hit another player (i.e.. shot it). |
boolean |
isItemPickedUp()
Tells whether this bot has picked up some item recently. |
boolean |
isItemPickedUpOnce()
Tells whether this bot has picked up some item recently. |
boolean |
isPlayerKilled()
Tells whether some other player has just died (we do not care which one). |
boolean |
isPlayerKilled(Player player)
Tells whether some other player has just died. |
boolean |
isPlayerKilled(UnrealId playerId)
Tells whether some other player of id 'playerId' has just died. |
boolean |
isPlayerKilledOnce()
Tells whether some other player has just died (we do not care which one). |
boolean |
isPlayerKilledOnce(Player player)
Tells whether some other player has just died. |
boolean |
isPlayerKilledOnce(UnrealId playerId)
Tells whether some other player of id 'playerId' has just died. |
boolean |
isShot()
Tells, whether the agent is being damaged by another player (i.e. was shot). |
boolean |
isShotOnce()
Tells, whether the agent is being damaged by another player (i.e. was shot). |
boolean |
seeIncomingProjectile()
Tells whether the bot see any incoming projectiles. |
boolean |
seeIncomingProjectileOnce()
Tells whether the bot see any incoming projectiles. |
protected void |
start(boolean startPaused)
Provides initialization of the module (clearing internal data structures). |
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double SENSE_THRESHOLD
protected AgentInfo agentInfo
Constructor Detail |
---|
public Senses(UDKBot bot)
bot
- owner of the module that is using itpublic Senses(UDKBot bot, AgentInfo agentInfo, Players players)
bot
- owner of the module that is using itagentInfo
- AgentInfo memory moduleplayers
- Players memory modulepublic Senses(UDKBot bot, AgentInfo agentInfo, Players players, Logger log)
bot
- owner of the module that is using itagentInfo
- AgentInfo memory module.log
- Logger to be used for logging runtime/debug info. If null, module creates its own logger.Method Detail |
---|
public boolean isCollidingOnce()
Note: This method clears the collision flag upon invocation. This is to prevent taking more action because of one collision.
public boolean isColliding()
public Location getCollisionLocation()
public javax.vecmath.Vector3d getCollisionNormal()
public boolean isBumping()
public boolean isBumpingOnce()
Note: This method clears the bumping flag upon invocation. This is to prevent taking more action because of one bumping.
public boolean isBumpingPlayer()
public boolean isBumpingPlayerOnce()
Note: This method clears the bumping flag upon invocation. This is to prevent taking more action because of one collision.
public Player getBumpingPlayer()
Player
object of the player the bot has bumped into (if it was a bot).
public Location getBumpLocation()
public boolean isFallEdge()
public boolean isFallEdgeOnce()
Note: This method clears the fall-edge flag upon invocation. This is to prevent taking more action because of one fall.
public boolean isHearingNoise()
public boolean isHearingNoiseOnce()
Note: This method clears the hearing-noise flag upon invocation. This is to prevent taking more action because of hearing the noise.
public Rotation getNoiseRotation()
public UnrealId getNoiseSource()
public String getNoiseType()
public boolean isHearingPickup()
public boolean isHearingPickupOnce()
Note: This method clears the hearing-pickup flag upon invocation. This is to prevent taking more action because of hearing the pickup.
public Rotation getPickupNoiseRotation()
public UnrealId getPickupNoiseSource()
public String getPickupNoiseType()
public boolean isBeingDamaged()
public boolean isBeingDamagedOnce()
Note: This method clears the being-damaged flag upon invocation. This is to prevent taking more action because of taking the damage.
public BotDamaged getLastDamage()
public boolean isShot()
public boolean isShotOnce()
Note: This method clears the shot flag upon invocation. This is to prevent taking more action because of taking the damage.
public BotDamaged getLastShot()
public boolean seeIncomingProjectile()
public boolean seeIncomingProjectileOnce()
public IncomingProjectile getLastIncomingProjectile()
public boolean isCausingDamage()
public boolean isCausingDamageOnce()
Note: This method clears the causing-damage flag upon invocation. This is to prevent taking more action because of causing the damage.
public PlayerDamaged getLastCausedDamage()
public boolean isHitPlayer()
public boolean isHitPlayerOnce()
Note: This method clears the player-hit flag upon invocation. This is to prevent taking more action because of hitting a player.
public PlayerDamaged getLastHitPlayer()
public boolean isPlayerKilled()
public boolean isPlayerKilledOnce()
Note: This method clears the arbitrary-player-killed flag upon invocation. This is to prevent taking more action because of killing a player.
public boolean isPlayerKilled(UnrealId playerId)
public boolean isPlayerKilled(Player player)
public boolean isPlayerKilledOnce(UnrealId playerId)
Note: This method clears the specific-player-killed flag upon invocation. This is to prevent taking more action because of killing a player.
playerId
-
public boolean isPlayerKilledOnce(Player player)
Note: This method clears the specific-player-killed flag upon invocation. This is to prevent taking more action because of killing a player.
player
-
public PlayerKilled getPlayerKilled(UnrealId playerId)
playerId
-
public PlayerKilled getPlayerKilled(Player player)
player
-
public boolean isAdrenalineGained()
public boolean isAdrenalineGainedOnce()
Note: This method clears the adrenaline-gained flag upon invocation. This is to prevent taking more action because of adrenaline gain.
public boolean hasDied()
public boolean hasDiedOnce()
Note: This method clears the bot-died flag upon invocation. This is to prevent taking more action because of bot death.
public BotKilled getBotDeath()
public boolean isItemPickedUp()
public boolean isItemPickedUpOnce()
Note: This method clears the pick-up flag upon invocation. This is to prevent taking more action because of item pickup.
public ItemPickedUp getItemPickedUp()
public Double getTimeDelta()
protected void start(boolean startPaused)
start
in class AgentModule<UDKBot>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |