Mooserwirt 2

A robot by Glyn Davies

Mooserwirt2 is my first serious attempt at writing a robocode robot. (Mooserwirt1 was little more than "MyFirstRobot", as I went through the tutorial learning robocode. It no longer exists.)
There are some brief notes on Mooserwirt2 below. I may have more details on my website (http://www.glyndavies.org/robocode), but then again, I may not. Sometimes I feel like telling the world in boring detail about exactly how it all works. (In the past, I've even put javadoc pages up there.) But then other times I start feeling a little competitive (like in the leadup to the Rumble. By sticking it on the web, I can always remove it if I'm feeling sneaky!

Features

No anti-gravity. Everyone seems to be using anti-gravity in various forms, so I figured competing against others using a similar technique would be tough. Instead, I applied some lateral thinking and tried to come up with a completely different tactic. I owe 'Tron' for the inspiration, although I have no idea if that robot does something similar.
Bullet avoidance The main feature of this robot is it's bullet avoidance. It has quite a sophisticated model for predicting and avoiding bullets. Probabilities are applied to each prediction, and the robot also considers the damage a bullet will do.
Dynamic robot prediction The targeting model allows for many different algorithms which predict where a robot will be at a point in the future. The appropriate algorithm is dynamically selected based on the most accurate algorithm for a particular robot. The accuracy statistics are based on observations of the robots, not by hit accuracy, so a view of the best algorithm to use is obtained very quickly. This also allows us to build stats on all robots at once, rather than just the guy we're targeting. Within the first few spins of the radar, we've already got a pretty good idea of the best algorithm to use for every robot in the field.
Multiple radar scanning Mooserwirt2 employs a fairly sophisticated radar algorithm that scans all robots on the field at once, although doesn't waste time scanning areas where there are no robots. For example, if Mooserwirt2 is in a corner, it should never need to scan back and forth more than 90 degrees. If the other robots are all in the same area, or are all roughly in line then it may get away with only scanning back and forth around 20 degrees. In any case, it always scans as wide as it needs to to watch everybody. Occasionally, it throws in a full 360 degree scan for fun, just to ensure no robots have squeezed into the battle without it noticing! This little feature is ripe for optimisation, but it was easier to code that way.