cz.cuni.amis.pogamut.ut2004.examples.botobserver
Class BotThatWillBeObserved

Package class diagram package BotThatWillBeObserved
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<BOT>
      extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController<BOT>
          extended by cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController
              extended by cz.cuni.amis.pogamut.ut2004.examples.botobserver.BotThatWillBeObserved
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.agent.module.IAgentLogic, IUT2004BotController, IUT2004BotLogicController

public class BotThatWillBeObserved
extends UT2004BotModuleController

Simple navigation bot that will run around the environment & will be observed by BotObserver.

Author:
Jakub Gemrot aka Jimmy

Field Summary
protected  UT2004PathAutoFixer autoFixer
          Path auto fixer watches for navigation failures and if some navigation link is found to be unwalkable, it removes it from underlying navigation graph.
protected  TabooSet<NavPoint> tabooNavPoints
          Taboo set is working as "black-list", that is you might add some NavPoints to it for a certain time, marking them as "unavailable".
protected  int talking
          NavigationBot#talking state.
protected  NavPoint targetNavPoint
          Current navigation point we're navigating to.
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController
act, body, combo, config, ctf, descriptors, fwMap, game, getBackToNavGraph, info, items, listenerRegistrator, move, navBuilder, navigation, pathExecutor, pathPlanner, players, random, raycasting, runStraight, senses, shoot, stats, visibility, weaponPrefs, weaponry, world
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
logicModule
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
bot, log, USER_LOG_CATEGORY_ID
 
Constructor Summary
BotThatWillBeObserved()
           
 
Method Summary
 void beforeFirstLogic()
          This method is called only once right before actual logic() method is called for the first time.
 void botInitialized(GameInfo gameInfo, ConfigChange config, InitedMessage init)
          The bot is initialized in the environment - a physical representation of the bot is present in the game.
 void botKilled(BotKilled event)
          Called each time our bot die.
 Initialize getInitializeCommand()
          Here we can modify initializing command for our bot.
protected  NavPoint getRandomNavPoint()
          Randomly picks some navigation point to head to.
 void logic()
          Main method that controls the bot - makes decisions what to do next.
static void main(String[] args)
          Method that runs the bot standalone.
protected  void pathExecutorStateChange(cz.cuni.amis.pogamut.base.agent.navigation.PathExecutorState state)
          Path executor has changed its state (note that UT2004BotModuleController.getPathExecutor() is internally used by UT2004BotModuleController.getNavigation() as well!).
static void startBot()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController
finishControllerInitialization, getBody, getCombo, getConfig, getDescriptors, getFwMap, getGame, getInfo, getItems, getMove, getNavBuilder, getNavigation, getPathExecutor, getPathPlanner, getPlayers, getRandom, getRaycasting, getSenses, getShoot, getStats, getVisibility, getWeaponPrefs, getWeaponry, getWorld, initializeController, initializeListeners, initializeModules, initializePathFinding
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotLogicController
getLogicInitializeTime, getLogicShutdownTime, initializeLogic, logicInitialize, logicShutdown
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController
botFirstSpawn, botShutdown, getAct, getBot, getLog, getPassword, getWorldView, prepareBot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController
botFirstSpawn, botShutdown, getAct, getBot, getLog, getPassword, getWorldView, prepareBot
 

Field Detail

tabooNavPoints

protected TabooSet<NavPoint> tabooNavPoints
Taboo set is working as "black-list", that is you might add some NavPoints to it for a certain time, marking them as "unavailable".


targetNavPoint

protected NavPoint targetNavPoint
Current navigation point we're navigating to.


autoFixer

protected UT2004PathAutoFixer autoFixer
Path auto fixer watches for navigation failures and if some navigation link is found to be unwalkable, it removes it from underlying navigation graph. Note that UT2004 navigation graphs are some times VERY stupid or contains VERY HARD TO FOLLOW links...


talking

protected int talking
NavigationBot#talking state.

Constructor Detail

BotThatWillBeObserved

public BotThatWillBeObserved()
Method Detail

getInitializeCommand

public Initialize getInitializeCommand()
Here we can modify initializing command for our bot.

Specified by:
getInitializeCommand in interface IUT2004BotController
Overrides:
getInitializeCommand in class UT2004BotController
Returns:

botInitialized

public void botInitialized(GameInfo gameInfo,
                           ConfigChange config,
                           InitedMessage init)
The bot is initialized in the environment - a physical representation of the bot is present in the game.

Specified by:
botInitialized in interface IUT2004BotController
Overrides:
botInitialized in class UT2004BotController
Parameters:
config - information about configuration
init - information about configuration

beforeFirstLogic

public void beforeFirstLogic()
This method is called only once right before actual logic() method is called for the first time.

Specified by:
beforeFirstLogic in interface cz.cuni.amis.pogamut.base.agent.module.IAgentLogic
Overrides:
beforeFirstLogic in class UT2004BotLogicController

logic

public void logic()
Main method that controls the bot - makes decisions what to do next. It is called iteratively by Pogamut engine every time a synchronous batch from the environment is received. This is usually 4 times per second - it is affected by visionTime variable, that can be adjusted in GameBots ini file in UT2004/System folder.

Specified by:
logic in interface cz.cuni.amis.pogamut.base.agent.module.IAgentLogic
Overrides:
logic in class UT2004BotLogicController

botKilled

public void botKilled(BotKilled event)
Called each time our bot die. Good for reseting all bot state dependent variables.

Specified by:
botKilled in interface IUT2004BotController
Overrides:
botKilled in class UT2004BotController
Parameters:
event -

pathExecutorStateChange

protected void pathExecutorStateChange(cz.cuni.amis.pogamut.base.agent.navigation.PathExecutorState state)
Path executor has changed its state (note that UT2004BotModuleController.getPathExecutor() is internally used by UT2004BotModuleController.getNavigation() as well!).

Parameters:
state -

getRandomNavPoint

protected NavPoint getRandomNavPoint()
Randomly picks some navigation point to head to.

Returns:
randomly choosed navpoint

startBot

public static void startBot()

main

public static void main(String[] args)
                 throws cz.cuni.amis.utils.exception.PogamutException
Method that runs the bot standalone.

Parameters:
args -
Throws:
cz.cuni.amis.utils.exception.PogamutException


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