cz.cuni.amis.pogamut.sposh.context
Class EmohawkBehaviour<BOT extends cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>

Package class diagram package EmohawkBehaviour
java.lang.Object
  extended by cz.cuni.amis.pogamut.sposh.JavaBehaviour<BOT>
      extended by cz.cuni.amis.pogamut.sposh.context.EmohawkBehaviour<BOT>

public class EmohawkBehaviour<BOT extends cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>
extends cz.cuni.amis.pogamut.sposh.JavaBehaviour<BOT>


Field Summary
protected  cz.cuni.amis.pogamut.base.communication.command.IAct act
          Shortcut for the UT2004BotController.getAct().
protected  Animations animations
          Module for handling animations.
protected  cz.cuni.amis.pogamut.ut2004.bot.command.Communication comm
          Allows you to speak!
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig config
          Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).
protected  Emoticons emoticons
          Module for handling emoticons.
protected  cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap fwMap
          Path-planner (IPathPlanner using NavPoints), you may use it to find paths inside the environment wihtout waiting for round-trip of GetPath command and PathLists response from UT2004.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
          Memory module specialized on general info about the game - game type, time limit, frag limit, etc.
protected  cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getBackToNavGraph
          Navigation helper that is able to get your bot back to the nearest navigation graph so you can use UT2004BotModuleController.navigation without fear of catastrophe.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo info
          Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.
protected  Inventory inventory
          High-level access to inventory and items.
protected  cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator listenerRegistrator
          Listener registrator that probes declared methods for the presence of EventListener, ObjectClassEventListener, ObjectClassListener, ObjectEventListener and ObjectListener annotations and automatically registers them as listeners on a specific events.
protected  cz.cuni.amis.pogamut.base.utils.logging.LogCategory log
          User's log.
protected  cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion move
          This allows you to manually steer the movement through the environment.
protected  cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation navigation
          Command module that is internally using UT2004PathExecutor for path-following and FloydWarshallMap for path planning resulting in unified class that can solely handle navigation of the bot within the environment.
protected  cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathExecutor
          Executor is used for following a path in the environment.
protected  cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathPlanner
          Planner used to compute the path (consisting of navigation points) inside the map.
protected  Places places
          High-level description of the map.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
          Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.
protected  Random random
          Random number generator that is usually useful to have during decision making.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting raycasting
          Support for creating rays used for raycasting (see AutoTraceRay that is being utilized).
protected  cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight runStraight
          Navigation helper that can run-straight to some point with stuck detectors.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses senses
          Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.
protected  cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats stats
          Module that is providing various statistics about the bot.
protected  Steering steering
          High-level access to steering library.
protected  cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView world
          Shortcut for the UT2004BotController.getWorldView().
 
Fields inherited from class cz.cuni.amis.pogamut.sposh.JavaBehaviour
bot
 
Constructor Summary
EmohawkBehaviour(String name, BOT bot)
           
 
Method Summary
 void botFirstSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self)
          This method is called only once whenever first batch of information what the bot can see is received.
 void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
          This method is called whenever InitedMessage is received.
 void finishBehaviourInitialization()
           
 cz.cuni.amis.pogamut.base.communication.command.IAct getAct()
           
 Animations getAnimations()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses getBotSenses()
           
 cz.cuni.amis.pogamut.ut2004.bot.command.Communication getComm()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig getConfig()
           
 Emoticons getEmoticons()
           
 cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap getFwMap()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game getGame()
           
 cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getGetBackToNavGraph()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo getInfo()
           
 Inventory getInventory()
           
 cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator getListenerRegistrator()
           
 cz.cuni.amis.pogamut.base.utils.logging.LogCategory getLog()
           
 cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion getMove()
           
 cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation getNavigation()
           
 cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> getPathExecutor()
           
 cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> getPathPlanner()
           
 Places getPlaces()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players getPlayers()
           
 Random getRandom()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting getRaycasting()
           
 cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight getRunStraight()
           
 cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats getStats()
           
 Steering getSteering()
           
 cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView getWorld()
           
 cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView getWorldView()
           
 void initializeBehaviour(BOT bot)
           
protected  void initializeListeners(BOT bot)
          Initializes UT2004BotModuleControllerNew#listenerRegistrator and calls AnnotationListenerRegistrator.addListeners() method to probe all declared methods for event-annotation presence.
protected  void initializeModules(BOT bot)
          Initializes memory/command modules of the bot.
protected  void initializePathFinding(BOT bot)
          Initializes path-finding modules: UT2004BotModuleControllerNew#pathPlanner, UT2004BotModuleController.fwMap and UT2004BotModuleControllerNew#pathExecutor.
protected  void prepareBehaviour(BOT bot)
          Called after the behaviour construction to initialize user's data structures.
 
Methods inherited from class cz.cuni.amis.pogamut.sposh.JavaBehaviour
doNothing, fail, getActions, getBot, getName, getSenses, logicAfterPlan, logicBeforePlan, succeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected cz.cuni.amis.pogamut.base.utils.logging.LogCategory log
User's log.


random

protected Random random
Random number generator that is usually useful to have during decision making.


game

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game game
Memory module specialized on general info about the game - game type, time limit, frag limit, etc.

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.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


info

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo info
Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc.

May be used since first Self message is received, i.e, since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


players

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players players
Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc.

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.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


senses

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses senses
Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc.

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.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


config

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig config
Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004).

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage) is called.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


raycasting

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting raycasting
Support for creating rays used for raycasting (see AutoTraceRay that is being utilized).

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.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


move

protected cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion move
This allows you to manually steer the movement through the environment.

Note: navigation is done via UT2004BotModuleControllerNew#pathExecutor that needs PathHandle from the UT2004BotModuleControllerNew#pathPlanner.

May be used since since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside UT2004BotModuleController.initializeModules(UT2004Bot).


comm

protected cz.cuni.amis.pogamut.ut2004.bot.command.Communication comm
Allows you to speak!


pathExecutor

protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathExecutor
Executor is used for following a path in the environment.

May be used since since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot).


pathPlanner

protected cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> pathPlanner
Planner used to compute the path (consisting of navigation points) inside the map.

May be used since since the first IUT2004BotController.botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.

Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot).


getBackToNavGraph

protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getBackToNavGraph
Navigation helper that is able to get your bot back to the nearest navigation graph so you can use UT2004BotModuleController.navigation without fear of catastrophe.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage) is called.

Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot).


runStraight

protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight runStraight
Navigation helper that can run-straight to some point with stuck detectors.

May be used since IUT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage) is called.

Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot).


navigation

protected cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation navigation
Command module that is internally using UT2004PathExecutor for path-following and FloydWarshallMap for path planning resulting in unified class that can solely handle navigation of the bot within the environment.

In contrast to UT2004PathExecutor methods of this module may be recalled every UT2004BotLogicController.logic() iteration even with the same argument (which is not true for BasePathExecutor.followPath(cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture).

Note that this class is actually initialized with instances of UT2004BotModuleController.pathExecutor and UT2004BotModuleController.fwMap so you must take care if using add/remove stuck detectors or reinitilize this property to your liking (you can do that in UT2004BotController.botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage) method.

May be used since first UT2004BotLogicController.logic() is called.

Initialized inside UT2004BotModuleController.initializePathFinding(UT2004Bot).


listenerRegistrator

protected cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator listenerRegistrator
Listener registrator that probes declared methods for the presence of EventListener, ObjectClassEventListener, ObjectClassListener, ObjectEventListener and ObjectListener annotations and automatically registers them as listeners on a specific events.

Note that this registrator is usable for 'this' object only! It will work only for 'this' object.


world

protected cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView world
Shortcut for the UT2004BotController.getWorldView().


act

protected cz.cuni.amis.pogamut.base.communication.command.IAct act
Shortcut for the UT2004BotController.getAct().


stats

protected cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats stats
Module that is providing various statistics about the bot. You may also used it to output these stats (in CSV format) into some file using AgentStats.startOutput(String) or AgentStats.startOutput(String, boolean).


fwMap

protected cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap fwMap
Path-planner (IPathPlanner using NavPoints), you may use it to find paths inside the environment wihtout waiting for round-trip of GetPath command and PathLists response from UT2004. It is much faster than UT2004BotModuleController.pathPlanner but you need to pass NavPoint instances to planner instead of ILocated ... to find the nearest NavPoint instance, DistanceUtils is a handy, check especially DistanceUtils.getNearest(java.util.Collection, ILocated).


animations

protected Animations animations
Module for handling animations.


emoticons

protected Emoticons emoticons
Module for handling emoticons.


places

protected Places places
High-level description of the map.


steering

protected Steering steering
High-level access to steering library.


inventory

protected Inventory inventory
High-level access to inventory and items.

Constructor Detail

EmohawkBehaviour

public EmohawkBehaviour(String name,
                        BOT bot)
Method Detail

prepareBehaviour

protected void prepareBehaviour(BOT bot)
Called after the behaviour construction to initialize user's data structures.

Parameters:
bot -

botInitialized

public void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo info,
                           cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
                           cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
This method is called whenever InitedMessage is received. Various agent modules are usable since this method is called.

Parameters:
gameInfo -
config -
init -
self -

botFirstSpawned

public void botFirstSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
                            cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange config,
                            cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init,
                            cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self)
This method is called only once whenever first batch of information what the bot can see is received. It is sort of "first-logic-method" where you may issue commands for the first time and handle everything else in bot's logic then. It eliminates the need to have 'boolean firstLogic' field inside your bot.

Note that this method has advantage over the IUT2004BotController.botInitialized(GameInfo, ConfigChange, InitedMessage) that you already have Self object.

Parameters:
gameInfo -
config -
init -
self -

initializeBehaviour

public void initializeBehaviour(BOT bot)

initializeListeners

protected void initializeListeners(BOT bot)
Initializes UT2004BotModuleControllerNew#listenerRegistrator and calls AnnotationListenerRegistrator.addListeners() method to probe all declared methods for event-annotation presence.

Parameters:
bot -

initializePathFinding

protected void initializePathFinding(BOT bot)
Initializes path-finding modules: UT2004BotModuleControllerNew#pathPlanner, UT2004BotModuleController.fwMap and UT2004BotModuleControllerNew#pathExecutor. If you need different path planner / path executor - override this method and initialize your own modules.

Parameters:
bot -

initializeModules

protected void initializeModules(BOT bot)
Initializes memory/command modules of the bot.

Parameters:
bot -

finishBehaviourInitialization

public void finishBehaviourInitialization()

getAct

public cz.cuni.amis.pogamut.base.communication.command.IAct getAct()

getWorldView

public cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView getWorldView()

getLog

public cz.cuni.amis.pogamut.base.utils.logging.LogCategory getLog()

getRandom

public Random getRandom()

getGame

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game getGame()

getInfo

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo getInfo()

getPlayers

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players getPlayers()

getBotSenses

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses getBotSenses()

getConfig

public cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig getConfig()

getRaycasting

public cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting getRaycasting()

getMove

public cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion getMove()

getComm

public cz.cuni.amis.pogamut.ut2004.bot.command.Communication getComm()

getPathExecutor

public cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> getPathExecutor()

getPathPlanner

public cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner<cz.cuni.amis.pogamut.base3d.worldview.object.ILocated> getPathPlanner()

getGetBackToNavGraph

public cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph getGetBackToNavGraph()

getRunStraight

public cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight getRunStraight()

getNavigation

public cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation getNavigation()

getListenerRegistrator

public cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator getListenerRegistrator()

getWorld

public cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView getWorld()

getStats

public cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats getStats()

getFwMap

public cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap getFwMap()

getAnimations

public Animations getAnimations()

getEmoticons

public Emoticons getEmoticons()

getPlaces

public Places getPlaces()

getSteering

public Steering getSteering()

getInventory

public Inventory getInventory()


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.