Difference between revisions of "Targeting with Genetic Algorithm"

From Robowiki
Jump to navigation Jump to search
(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...")
 
Line 4: Line 4:
  
 
Of course there can be lots of other ways but I will say how I used it on [[WormHole]].
 
Of course there can be lots of other ways but I will say how I used it on [[WormHole]].
 +
[[WormHole]] improves it's gun with genetic algorithms during the match.
 
;''Guessing the nodes''
 
;''Guessing the nodes''
  

Revision as of 08:47, 25 January 2017

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. WormHole improves it's gun with genetic algorithms during the match.

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.