Targeting with Genetic Algorithm

From Robowiki
Revision as of 09:36, 25 January 2017 by Dsekercioglu (talk | contribs) (Created page with "Simply it is determining the GF values in the nodes with genetic algorithm. ==How To Use Genetic Algorithm In Targeting== Of course there can be lots of other ways but I...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simply it is determining the GF values in the nodes with genetic algorithm.

How To Use Genetic Algorithm In Targeting

Of course there can be lots of other ways but I will say how I used it on WormHole.

Guessing the nodes
Make a standard segmented [GF] gun. Remove the bins so there will be only one GF value there.
Then with genetic algorithm create some chromosomes that has their own stats.
Keep a track of your firing data like {latVelWhenFired, advVelWhenFired, hit GF} so you will be able to use it in fitness method.
Then sort the chromosomes and get the first chromosome in the list. Put the first chromosome's stats to your real stats.
Mutation
Normally mutation in genetic algorithm can hurt the genes or it can make it better.
Generally it is randomised.
In robocode for adapting fast it randomly takes an index (index = size - (int)Math.round(Math.random() * 10)) like this code for using valid data.
If enemy is disabled mutation will help it to adapt quickly.