Public Group

#### Archived

This topic is now archived and is closed to further replies.

# Genetic Algorithms help...

This topic is 5175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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...

##### Share on other sites
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.

##### Share on other sites
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?

##### Share on other sites
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

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002140
×