Genetic Algorithms help...

Started by
2 comments, last by J-Ral 19 years, 11 months ago
Hi there, Im studying Artificial Intelligence. I have a project where i am to create a strategy for a robot soccer player via a genetic algorithm. I am feeling kinda stuck on what to do for the following: - an effective fitness function; an easy one would be whether players win or not but i think thats not gonna be good enough - how to encode the chromosome - an effective cost function plus a lot of other stuff but that would be a good start. Any suggestions, or even suggestions of where i can get help would be most appreciated!! Cheers! Trace back the elements...
Trace back the elements...
Advertisement
For a fitness function I suppose it depends upon how complicated you want to get. I''d probably suggest something along the lines of a combination of the following factors: whether the robot can see the ball, the distance from the other players on the same team, distance from players on the opposing team.
Length of time the ball is in the robot''s possession, Distance ball is kicked, Ability to hit a target, number of times a robot looses a challenge for ball possession?
The cost needs to be a multiplication with the more important value having a greater multiplication value attached. i.e. if the accuracy of shooting is more important than ability to survive tackles give the cost of accuracy a higher mulitplication value. Of course you can then tailor the multiplication values for different sets of players. i.e. it is more important for a defender to be able to win tackles than shoot accurately, but the inverse for a striker.

I find that the easiest way to encode a genetic algorithm is to have numberic values that directly relate to performance. I suppose in this instance you could have encode a chromosome like this:

111:324:211

where the first three numbers reflect the players ability to
a: shoot accurately at goal
b: pass accurately
c: distance they can kick

second three are:
a: Ability to resist tackle
b: ability to tackle striker
c: ability to tackle defender

etc.

Of course you would have to link values so that a high accuracy at goal means that they have a low ability to resist tackles. Otherwise your players will make themselves out.

A possible cross between two chromosomes could therefore be:

111:111:444
x
444:222:111

=

411:122:112

Note the last value which has been lowered from 4 to 2 due to the fact that the first gene has a score of 4.

As if this wasn''t complicated enough don''t forget to include a mutation value, and you may want to look into elitism. If the population is small don''t use elitism and ramp up the mutation rate. For a large population lower the mutation rate and add elitism.

Phew.

DRb2k2


This topic is closed to new replies.

Advertisement