[UPDATE: 11 September 2003] I've just posted a few classes on sf.net CVS server. Not working at the moment and with many outdated classes... the only new thing is the plugin framework -- Simonech
Description
I'm in the process of developing, both for the utility of the tool itself and also to learn Java Programming better (and more specifically standalone apps programming and Swing), a program to, as the name itself says, optimize your Bot, or better, let you optimize parameters inside your bot code.
A problem with my bot, but I think with almost all bots, is that algoritm are ok (more or less) but their effectivness is compromized by wrong or not-so-good paramters. For example I've a costant for bulletPower (bulletPower=distance/BULLET_POWER_CONSTANT) and now I use BULLET_POWER_CONSTANT=300, but maybe it would be better (gives a better overall results) a BULLET_POWER_CONSTANT=250 or BULLET_POWER_CONSTANT=400.
If you have just one costant you can change the code, recompile the bot and test again, but if u have 20 constants, all with a range of 10 possible values you would have 10E20 possible parameter set and doing this tuning by hand will be very very long and very boring.
Mainly the program will work that way:
Since I cannot decide which optimization routine is better I've decided that I'll develop the program to be easyly extendable with a plugin-like pattern... I'm developing an interface that the optimization routine class must implement to be plugged into the main engine.
Some possible routines are:
Hope to have enough time to develop this tool. --Simonech
This sounds really interesting! Hope you get it to work :-) -- Vic
What about parameters that are not linear? For instance it might be better to have firepower 3 at 100, 200, but firepower 1 at 300?? -- wolfman
You can non-linearise after just do :
if(GeneticParameter<0.5) parameter=1;
else if(GeneticParameter<0.75) parameter=2;
and so on;
I suggest you to use different genetic algorithm like
I've been working on an optimizer based on Evolutionary Programming (similar to a Genetic Algorithm), and I've found that Robocode scores are a horrible way to judge an individual's fitness. The results are just too random to be useful, and my own fitness function destroys my population from generation to generation because the best bots don't necessarily go on. In order to get evolutionary algorithms to work, the fitness function has to be consistent (that is, give the same value for the same individual over multiple tests), and so it is necessary to come up with alternative way to judge a bot's fitness other than his score. For instance, I am now using a function that calculates the flatness of my bot's curve to tune my movement, and though there is still randomness involved, it is a better function than score by far.
-- nano
In the sense of flatness and maybe even predictability, I have a tool that can tell me what the most predictable/least flat segments are for any bot against FloodMini. Given a good number of rounds (couple thousand?) it will be able to see the trends in almost any segment and tell you which ones are particularly weak. It can also be limited to a range of segments you particularly care about. If I made a similar tool for a gun that doesn't take such shortcuts (like FloodHT), it could be a useful rating test, as well. -- Kawigi
I can only add that I tried this approach with a genetic algorithm and Robocode scores after a thousand battles agains a few bots, but failed miserably. The bots got better, but only a percent or two before they stabilized, while it took ages to evaluate a single generation. Maybe I should've tried harder with other evaluation functions and/or more patience, but in the end I discovered it is more fun, satisfying and efficient to simply add and try out new ideas. Anyway, don't let my bad experience stop you, and lots of luck :) -- FnH
To show other people how far I'm going with the development of the optimizer I've posted my project on SourceForce?: you can see docs, news, file relase, post forum messages, browse the cvs tree and so on under the https://sourceforge.net/projects/botoptimizer botoptimizer page -- Simonech