dash2 has asked for the wisdom of the Perl Monks concerning the following question:
Iterations of the Prisoner's Dilemma prove interesting things about what a "successful" strategy is. (See Axelrod, The Evolution of Co-operation). I would love to build a genetic algorithm to play the prisoner's dilemma, and see what evolves. (I know it has been done before, but I like DIY.)
It's all easy apart from the genetic algorithm bit. My scribbled notes suggest this - NB I am an amateur and don't have any academic background in the field:
Use 1 for cooperation, 0 for defection. The DNA is a string of elements which operate successively to come up with a final 1 or 0.
Start with 1. (Or 0 - does it matter?)
DNA letter meanings:
Ax - "and" with x
Ox - "or" with x
Sx - save in register, start again with x
"x" can be any of:
D - defect. 0.
C - cooperate. 1.
number - opponent's strategy in game played number rounds previously
number - own strategy in game played number rounds previously. This can be distinguished by e.g. using odd for opponent, even for self; or adding 100 to self.
R - retrieve result from register
I know this wastes space and it should all be bit vectors or whatever, but ignore that. My questions:
Could it be simpler? Do I need a "register"?
Should it be more complicated? Will adding complications allow for more powerful solutions?
Related to the "register" issue: does a simple linear program like this allow for different priorities? To put it another way, can you express "(1 and 0) or 1" as well as "1 and (0 or 1)" without the brackets?
How "atomic" should individual DNA elements be? E.g. should an element mean "and" and be coupled with the next element (disadvantage - some mutations might "not work" at all) or should an element mean "and with such and such" (seems less flexible, easier to write though).
A gene pool of 100 players all playing each other means 100*99 games (maths?) in a single generation. How can I make this bearably fast?
I'd be very interested to hear comments from people with a CS background.
best,
dave hj~
NB: I found this page describing Axelrod's work with this. He uses simple brute force rather than a "programming language" approach. The downside is each player can only remember the last 3 games, and this is built in. Clever though.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Genetic algorithms
by Matts (Deacon) on May 23, 2002 at 10:54 UTC | |
Re: Genetic algorithms
by lhoward (Vicar) on May 23, 2002 at 12:05 UTC | |
Re: Genetic algorithms (OT!)
by educated_foo (Vicar) on May 23, 2002 at 15:29 UTC | |
Re: Genetic algorithms
by mojotoad (Monsignor) on May 23, 2002 at 17:25 UTC | |
Re: Genetic algorithms
by nop (Hermit) on May 24, 2002 at 02:41 UTC |