1 package cz.cuni.amis.pogamut.sposh.context; 2 3 import java.util.Random; 4 import java.util.logging.Level; 5 6 import cz.cuni.amis.pogamut.base.agent.navigation.IPathPlanner; 7 import cz.cuni.amis.pogamut.base.communication.command.IAct; 8 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.AnnotationListenerRegistrator; 9 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.EventListener; 10 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectClassEventListener; 11 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectClassListener; 12 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectEventListener; 13 import cz.cuni.amis.pogamut.base.communication.worldview.listener.annotation.ObjectListener; 14 import cz.cuni.amis.pogamut.base.utils.logging.LogCategory; 15 import cz.cuni.amis.pogamut.base.utils.math.DistanceUtils; 16 import cz.cuni.amis.pogamut.base3d.worldview.IVisionWorldView; 17 import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated; 18 import cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.Animations; 19 import cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.Emoticons; 20 import cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.Inventory; 21 import cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.Places; 22 import cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.Steering; 23 import cz.cuni.amis.pogamut.sposh.JavaBehaviour; 24 import cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.AgentConfig; 25 import cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric.Raycasting; 26 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo; 27 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentStats; 28 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game; 29 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Players; 30 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Senses; 31 import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004AStarPathPlanner; 32 import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004GetBackToNavGraph; 33 import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004Navigation; 34 import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004PathExecutor; 35 import cz.cuni.amis.pogamut.ut2004.agent.navigation.UT2004RunStraight; 36 import cz.cuni.amis.pogamut.ut2004.agent.navigation.floydwarshall.FloydWarshallMap; 37 import cz.cuni.amis.pogamut.ut2004.agent.navigation.loquenavigator.KefikRunner; 38 import cz.cuni.amis.pogamut.ut2004.agent.navigation.loquenavigator.LoqueNavigator; 39 import cz.cuni.amis.pogamut.ut2004.agent.navigation.stuckdetector.UT2004DistanceStuckDetector; 40 import cz.cuni.amis.pogamut.ut2004.agent.navigation.stuckdetector.UT2004PositionStuckDetector; 41 import cz.cuni.amis.pogamut.ut2004.agent.navigation.stuckdetector.UT2004TimeStuckDetector; 42 import cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController; 43 import cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedLocomotion; 44 import cz.cuni.amis.pogamut.ut2004.bot.command.Communication; 45 import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot; 46 import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController; 47 import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotModuleController; 48 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.GetPath; 49 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.AutoTraceRay; 50 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange; 51 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo; 52 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage; 53 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPoint; 54 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PathList; 55 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self; 56 57 58 // 59 // 3rd change 60 // 61 62 public class EmohawkBehaviour<BOT extends UT2004Bot> extends JavaBehaviour<BOT> { 63 64 /** 65 * User's log. 66 */ 67 protected LogCategory log; 68 69 /** 70 * Random number generator that is usually useful to have during decision making. 71 */ 72 protected Random random = new Random(System.currentTimeMillis()); 73 74 /** 75 * Memory module specialized on general info about the game - game type, time limit, frag limit, etc. 76 * <p><p> 77 * May be used since {@link 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)} 78 * is called. 79 * <p><p> 80 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 81 */ 82 protected Game game; 83 84 /** 85 * Memory module specialized on general info about the agent whereabouts - location, rotation, health, current weapon, who is enemy/friend, etc. 86 * <p><p> 87 * May be used since first {@link Self} message is received, i.e, since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 88 * is called. 89 * <p><p> 90 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 91 */ 92 protected AgentInfo info; 93 94 /** 95 * Memory module specialized on whereabouts of other players - who is visible, enemy / friend, whether bot can see anybody, etc. 96 * <p><p> 97 * May be used since {@link 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)} 98 * is called. 99 * <p><p> 100 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 101 */ 102 protected Players players; 103 104 // /** 105 // * Sensory module that provides mapping between {@link ItemType} and {@link ItemDescriptor} providing 106 // * an easy way to obtain item descriptors for various items in UT2004. 107 // * <p><p> 108 // * May be used since {@link 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)} 109 // * is called. 110 // * <p><p> 111 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 112 // */ 113 // protected ItemDescriptors descriptors; 114 115 // /** 116 // * Memory module specialized on items on the map - which are visible and which are probably spawned. 117 // * <p><p> 118 // * May be used since {@link 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)} 119 // * is called. 120 // * <p><p> 121 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 122 // */ 123 // protected Items items; 124 125 /** 126 * Memory module specialized on agent's senses - whether the bot has been recently killed, collide with level's geometry, etc. 127 * <p><p> 128 * May be used since {@link 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)} 129 * is called. 130 * <p><p> 131 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 132 */ 133 protected Senses senses; 134 135 // /** 136 // * Memory module specialized on info about the bot's weapon and ammo inventory - it can tell you which weapons are loaded, melee/ranged, etc. 137 // * <p><p> 138 // * May be used since {@link 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)} 139 // * is called. 140 // * <p><p> 141 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 142 // */ 143 // protected Weaponry weaponry; 144 145 /** 146 * Memory module specialized on the agent's configuration inside UT2004 - name, vision time, manual spawn, cheats (if enabled at GB2004). 147 * <p><p> 148 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage)} 149 * is called. 150 * <p><p> 151 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 152 */ 153 protected AgentConfig config; 154 155 /** 156 * Support for creating rays used for raycasting (see {@link AutoTraceRay} that is being utilized). 157 * <p><p> 158 * May be used since {@link 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)} 159 * is called. 160 * <p><p> 161 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 162 */ 163 protected Raycasting raycasting; 164 165 // /** 166 // * Wraps all available commands that can be issued to the virtual body of the bot inside UT2004. 167 // * <p><p> 168 // * May be used since since the first {@link IUT2004BotController#botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 169 // * is called. 170 // * <p><p> 171 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 172 // */ 173 // protected CompleteBotCommandsWrapper body; 174 175 // /** 176 // * Shortcut for <i>body.getAdvancedShooting()</i> that allows you to shoot at opponent. 177 // * <p><p> 178 // * Note: more weapon-handling methods are available through {@link UT2004BotModuleControllerNew#weaponry}. 179 // * <p><p> 180 // * May be used since since the first {@link IUT2004BotController#botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 181 // * is called. 182 // * <p><p> 183 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 184 // */ 185 // protected ImprovedShooting shoot; 186 187 /** 188 * This allows you to manually steer the movement through the environment. 189 * <p><p> 190 * Note: navigation is done via {@link UT2004BotModuleControllerNew#pathExecutor} that needs {@link PathHandle} from the {@link UT2004BotModuleControllerNew#pathPlanner}. 191 * <p><p> 192 * May be used since since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 193 * is called. 194 * <p><p> 195 * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 196 */ 197 protected AdvancedLocomotion move; 198 199 /** 200 * Allows you to speak! 201 */ 202 protected Communication comm; 203 204 /** 205 * Executor is used for following a path in the environment. 206 * <p><p> 207 * May be used since since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 208 * is called. 209 * <p><p> 210 * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}. 211 */ 212 protected UT2004PathExecutor<ILocated> pathExecutor = null; 213 214 /** 215 * Planner used to compute the path (consisting of navigation points) inside the map. 216 * <p><p> 217 * May be used since since the first {@link IUT2004BotController#botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self)} 218 * is called. 219 * <p><p> 220 * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}. 221 */ 222 protected IPathPlanner<ILocated> pathPlanner = null; 223 224 // /** 225 // * Navigation graph builder that may be used to manually extend the navigation graph of the UT2004. 226 // * <p><p> 227 // * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 228 // * is called. 229 // * <p><p> 230 // * Initialized inside {@link UT2004BotModuleController#initializeModules(UT2004Bot)}. 231 // */ 232 // protected NavigationGraphBuilder navBuilder = null; 233 234 /** 235 * Navigation helper that is able to get your bot back to the nearest navigation graph so you can use {@link UT2004BotModuleController#navigation} 236 * without fear of catastrophe. 237 * <p><p> 238 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 239 * is called. 240 * <p><p> 241 * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}. 242 */ 243 protected UT2004GetBackToNavGraph getBackToNavGraph; 244 245 /** 246 * Navigation helper that can run-straight to some point with stuck detectors. 247 * <p><p> 248 * May be used since {@link IUT2004BotController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 249 * is called. 250 * <p><p> 251 * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}. 252 */ 253 protected UT2004RunStraight runStraight; 254 255 /** 256 * Command module that is internally using {@link UT2004PathExecutor} for path-following and {@link FloydWarshallMap} 257 * for path planning resulting in unified class that can solely handle navigation of the bot within the environment. 258 * <p><p> 259 * In contrast to {@link UT2004PathExecutor} methods 260 * of this module may be recalled every {@link UT2004BotModuleController#logic()} iteration even with 261 * the same argument (which is not true for {@link UT2004PathExecutor#followPath(cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture)}. 262 * <p><p> 263 * Note that this class is actually initialized with instances of {@link UT2004BotModuleController#pathExecutor} and {@link UT2004BotModuleController#fwMap} 264 * so you must take care if using add/remove stuck detectors or reinitilize this property to your liking (you can do that in {@link UT2004BotModuleController#botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage)} 265 * method. 266 * <p><p> 267 * May be used since first {@link UT2004BotModuleController#logic()} is called. 268 * <p><p> 269 * Initialized inside {@link UT2004BotModuleController#initializePathFinding(UT2004Bot)}. 270 */ 271 protected UT2004Navigation navigation; 272 273 /** 274 * Listener registrator that probes declared methods for the presence of {@link EventListener}, {@link ObjectClassEventListener}, 275 * {@link ObjectClassListener}, {@link ObjectEventListener} and {@link ObjectListener} annotations and automatically registers 276 * them as listeners on a specific events. 277 * <p><p> 278 * Note that this registrator is usable for 'this' object only! It will work only for 'this' object. 279 */ 280 protected AnnotationListenerRegistrator listenerRegistrator; 281 282 // /** 283 // * Weapon preferences for your bot. See {@link WeaponPrefs} class javadoc. It allows you to define preferences for 284 // * weapons to be used at given distance (together with their firing mode). 285 // */ 286 // protected WeaponPrefs weaponPrefs; 287 288 /** 289 * Shortcut for the {@link UT2004BotModuleController#getWorldView()}. 290 */ 291 protected IVisionWorldView world; 292 293 /** 294 * Shortcut for the {@link UT2004BotModuleController#getAct()}. 295 */ 296 protected IAct act; 297 298 /** 299 * Module that is providing various statistics about the bot. You may also used it to output these stats (in CSV format) 300 * into some file using {@link AgentStats#startOutput(String)} or {@link AgentStats#startOutput(String, boolean)}. 301 */ 302 protected AgentStats stats; 303 304 /** 305 * Path-planner ({@link IPathPlanner} using {@link NavPoint}s), you may use it to find paths inside the environment wihtout 306 * waiting for round-trip of {@link GetPath} command and {@link PathList}s response from UT2004. It is much faster than 307 * {@link UT2004BotModuleController#pathPlanner} but you need to pass {@link NavPoint} instances to planner instead of 308 * {@link ILocated} ... to find the nearest {@link NavPoint} instance, {@link DistanceUtils} is a handy, check especially 309 * {@link DistanceUtils#getNearest(java.util.Collection, ILocated)}. 310 */ 311 protected FloydWarshallMap fwMap; 312 313 /** 314 * Module for handling animations. 315 */ 316 protected Animations animations; 317 318 /** 319 * Module for handling emoticons. 320 */ 321 protected Emoticons emoticons; 322 323 /** 324 * High-level description of the map. 325 */ 326 protected Places places; 327 328 /** 329 * High-level access to steering library. 330 */ 331 protected Steering steering; 332 333 /** 334 * High-level access to inventory and items. 335 */ 336 protected Inventory inventory; 337 338 public EmohawkBehaviour(String name, BOT bot) { 339 super(name, bot); 340 log = bot.getLogger().getCategory(UT2004BotController.USER_LOG_CATEGORY_ID); 341 log.setLevel(Level.ALL); 342 } 343 344 /** 345 * Called after the behaviour construction to initialize user's data structures. 346 * @param bot 347 */ 348 protected void prepareBehaviour(BOT bot) { 349 } 350 351 /** 352 * This method is called whenever {@link InitedMessage} is received. Various agent modules are usable since this 353 * method is called. 354 * 355 * @param gameInfo 356 * @param config 357 * @param init 358 * @param self 359 */ 360 public void botInitialized(GameInfo info, ConfigChange config, InitedMessage init) { 361 } 362 363 /** 364 * This method is called only once whenever first batch of information what the bot can see is received. 365 * <i><i> 366 * It is sort of "first-logic-method" where you may issue commands for the first time and handle everything 367 * else in bot's logic then. It eliminates the need to have 'boolean firstLogic' field inside your bot. 368 * <p><p> 369 * Note that this method has advantage over the {@link IUT2004BotController#botInitialized(GameInfo, ConfigChange, InitedMessage)} 370 * that you already have {@link Self} object. 371 * 372 * @param gameInfo 373 * @param config 374 * @param init 375 * @param self 376 */ 377 public void botFirstSpawned(GameInfo gameInfo, ConfigChange config, InitedMessage init, Self self) { 378 } 379 380 public void initializeBehaviour(BOT bot) { 381 world = getWorldView(); 382 act = getAct(); 383 initializeModules(bot); 384 initializePathFinding(bot); 385 initializeListeners(bot); 386 } 387 388 /** 389 * Initializes {@link UT2004BotModuleControllerNew#listenerRegistrator} and calls {@link AnnotationListenerRegistrator#addListeners()} method 390 * to probe all declared methods for event-annotation presence. 391 * @param bot 392 */ 393 protected void initializeListeners(BOT bot) { 394 listenerRegistrator = new AnnotationListenerRegistrator(this, getWorldView(), bot.getLogger().getCategory("Listeners")); 395 listenerRegistrator.addListeners(); 396 } 397 398 /** 399 * Initializes path-finding modules: {@link UT2004BotModuleControllerNew#pathPlanner}, {@link UT2004BotModuleController#fwMap} and {@link UT2004BotModuleControllerNew#pathExecutor}. 400 * If you need different path planner / path executor - override this method and initialize your own modules. 401 * @param bot 402 */ 403 protected void initializePathFinding(BOT bot) { 404 pathPlanner = new UT2004AStarPathPlanner(bot); 405 fwMap = new FloydWarshallMap(bot); 406 pathExecutor = 407 new UT2004PathExecutor<ILocated>( 408 bot, 409 new LoqueNavigator<ILocated>(bot, 410 bot.getLog()) 411 ); 412 413 // add stuck detectors that watch over the path-following, if it (heuristicly) finds out that the bot has stuck somewhere, 414 // it reports an appropriate path event and the path executor will stop following the path which in turn allows 415 // us to issue another follow-path command in the right time 416 pathExecutor.addStuckDetector(new UT2004TimeStuckDetector(bot, 3000, 100000)); // if the bot does not move for 3 seconds, considered that it is stuck 417 pathExecutor.addStuckDetector(new UT2004PositionStuckDetector(bot)); // watch over the position history of the bot, if the bot does not move sufficiently enough, consider that it is stuck 418 pathExecutor.addStuckDetector(new UT2004DistanceStuckDetector(bot)); // watch over distances to target 419 420 getBackToNavGraph = new UT2004GetBackToNavGraph(bot, info, move); 421 runStraight = new UT2004RunStraight(bot, info, move); 422 navigation = new UT2004Navigation(bot, pathExecutor, fwMap, getBackToNavGraph, runStraight); 423 } 424 425 /** 426 * Initializes memory/command modules of the bot. 427 * 428 * @param bot 429 */ 430 protected void initializeModules(BOT bot) { 431 game = new Game(bot); 432 info = new AgentInfo(bot, game); 433 players = new Players(bot); 434 // descriptors = new ItemDescriptors(bot); 435 // weaponry = new Weaponry(bot, descriptors); 436 // items = new Items(bot, info, game, weaponry, null); 437 senses = new Senses(bot, info, players); 438 config = new AgentConfig(bot); 439 raycasting = new Raycasting(bot); 440 // shoot = body.getImprovedShooting(); 441 move = new AdvancedLocomotion(getBot(), getBot().getLogger().getCategory("Move")); 442 comm = new Communication(getBot(), getBot().getLogger().getCategory("Communicaton")); 443 // navBuilder = new NavigationGraphBuilder(bot); 444 stats = new AgentStats(bot); 445 animations = new Animations(bot); 446 emoticons = new Emoticons(bot); 447 places = new Places(bot); 448 steering = new Steering(bot); 449 inventory = new Inventory(bot); 450 // weaponPrefs = new WeaponPrefs(weaponry, bot); 451 } 452 453 public void finishBehaviourInitialization() { 454 // if (navBuilder.isUsed()) { 455 // log.info("Navigation graph has been altered by 'navBuilder', triggering recomputation of Floyd-Warshall path matrix..."); 456 // Level oldLevel = fwMap.getLog().getLevel(); 457 // fwMap.getLog().setLevel(Level.FINER); 458 // fwMap.refreshPathMatrix(); 459 // fwMap.getLog().setLevel(oldLevel); 460 // } 461 } 462 463 public IAct getAct() { 464 return act; 465 } 466 467 public IVisionWorldView getWorldView() { 468 return getBot().getWorldView(); 469 } 470 471 public LogCategory getLog() { 472 return log; 473 } 474 475 public Random getRandom() { 476 return random; 477 } 478 479 public Game getGame() { 480 return game; 481 } 482 483 public AgentInfo getInfo() { 484 return info; 485 } 486 487 public Players getPlayers() { 488 return players; 489 } 490 491 public Senses getBotSenses() { 492 return senses; 493 } 494 495 public AgentConfig getConfig() { 496 return config; 497 } 498 499 public Raycasting getRaycasting() { 500 return raycasting; 501 } 502 503 public AdvancedLocomotion getMove() { 504 return move; 505 } 506 507 public Communication getComm() { 508 return comm; 509 } 510 511 public UT2004PathExecutor<ILocated> getPathExecutor() { 512 return pathExecutor; 513 } 514 515 public IPathPlanner<ILocated> getPathPlanner() { 516 return pathPlanner; 517 } 518 519 public UT2004GetBackToNavGraph getGetBackToNavGraph() { 520 return getBackToNavGraph; 521 } 522 523 public UT2004RunStraight getRunStraight() { 524 return runStraight; 525 } 526 527 public UT2004Navigation getNavigation() { 528 return navigation; 529 } 530 531 public AnnotationListenerRegistrator getListenerRegistrator() { 532 return listenerRegistrator; 533 } 534 535 public IVisionWorldView getWorld() { 536 return world; 537 } 538 539 public AgentStats getStats() { 540 return stats; 541 } 542 543 public FloydWarshallMap getFwMap() { 544 return fwMap; 545 } 546 547 public Animations getAnimations() { 548 return animations; 549 } 550 551 public Emoticons getEmoticons() { 552 return emoticons; 553 } 554 555 public Places getPlaces() { 556 return places; 557 } 558 559 public Steering getSteering() { 560 return steering; 561 } 562 563 public Inventory getInventory() { 564 return inventory; 565 } 566 567 }