Second Genebat Applet

D. Joyce, J. Kennison, N. Thompson
Departments of Mathematics and Psychology
Clark University
May, 2002



The Second Genebat Applet. See below for an explanation.



This is a variation of the first Genebat Applet. Read its description before going on.

The genomes are the same, with the same 23 genes. As with the first Genebat Applet, strategies are randomly selected for all the players, then they play match after match, with some players being removed (at random), and new players replacing them, this time where again, the strategy for the new player is selected at random, but not necessarily the same way as in the first Genebat Applet.

Reproduction

In the first Genebat Applet the probability that a player gets a strategy like a previously existing player was proportional the existing player's score. That is, strategies reproduced "asexually" where the reproduction rate was proportional to the player's scores. If you set the "asexual" parameter to 100% on this second Genebat Applet, then you get the same thing.

"Sexual" reproduction is also possible. The way that works in this model is roughly based on conjugation in bacteria. When a new player is to get a strategy based on sexual reproduction (and how often that occurs depends on the setting of the "asexual" parameter in the applet), then two existing player's are selected at random proportionally to their scores, and their genomes are mixed to produce a new strategy. The mixing occurs as follows: for each gene one of the two players' genes is selected with 50% probability. The 23 genes are selected independently, so roughly half the genes for the new player will come from each of the existing players.

Mutations

There were no mutations in the first Genebat Applet. There can be in the second. The "mutate rate" parameter determines how many mutations will occur. If it's set to 0, then there won't be any. Thus, if you set "asexual" to 100% and "mutate rate" to 0, then the simulations in the two applets will be the same (but the reports will be different, see below). If the mutation rate is nonzero, say 0.01, then after each match after the new players are selected, that fraction of the players' will have their genomes mutated. More precisely, the probablility that any individual player will get its genome mutated is that rate.

When a genome is mutated, each of its genes will be adjusted. The gene has a value between 0 and 1 which indicates the probablity that it will defect on a move, or that it will leave after a play. When it gets adjusted in a mutation, that value will be adjusted by uniformly selecting a number between 0.1 below its old value and 0.1 above its old value. Since the new number can't be above 1 or below 0, if it's above 1, then it's reduced back to 1, but if it's below 0, then it's reset to 0. For instance, if the old value was 0.95, then a number is selected uniformly on the interval from 0.85 to 1.05, but whenever a number is selected above 1.0, it's reduced, so the new value will be between 0.85 and 1.0, with the number 1.0 selected 25% of the time.

Reports

The text report is gone, and so is the graph that gives the relative populations for the strategies. They're replaced by two other graphs.

The graph at the top gives the populations of the strategies as before, but not in the same way since with mutations and sexual strategy selection, all the players can have different strategies, and frequently do. Instead, each horizontal line gives the strategy for one player, and when that player is removed and a new player replaces it, the new player's strategy will be displayed on that line.

The color of the strategy is, in this applet, completely determined by the values of the first three genes. (You'll be able to select which three genes in the next applet.) The first gene determines the probablity of defecting on the first move. That probability determines the red component of the color; if it usually defects, then the red component will be high; if it usually cooperates, then the red component will be low. The second gene determines whether the player will leave if its partner just cooperated. This second probability determines the green component of the color; if a player usually leaves after the partner cooperates, then the green component is high; if it usually stays, then the green component is low. The third gene determines whether the player will leave if its partner just defected. The third gene determines the blue component of the color. Thus, the whole color indicates the beginning stages of a strategy, but not the later part of a strategy.

Below is a table of the extreme colors. Since most probabilites won't be exactly 0.0 or 1.0 (which is * in the table), most of the colors you see will be intermediate colors.

GenesColorInterpretation
000blackcooperate, stay
*00reddefect, stay
0*0greencooperate, leave if partner cooperated
00*bluecooperate, leave if partner defected
**0yellowdefect, leave if partner cooperated
*0*magentadefect, leave if partner defected
0**cyancooperate, leave
***whitedefect, leave

The other graph is a long white bar with 23 gray rectangles hopping up and down, except the first three rectangles are red, green, and blue, instead of gray. Each one is for one of the genes. Each rectangle has a black bar across its middle. This black bar gives the mean value for that gene for the entire population of players. The rectangle goes one standard deviation above and below the mean. If the rectangle is high, then that gene has a high average value for the players; if low, low. If the rectangle is tall, then there's a large variation for that gene among the players. If the rectange is short, then that gene has about the same value for all the players. Sometimes the rectangle is so short that only the black line is visible, and that means all the players have the same value for that gene.

Comments

Any?

The files for this applet are listed here. The Genebat2.html
file is this file you're looking at. The *.java files
are the program source files for the applet. The *.class
files are the compiled files that run when the applet is
running. They're all needed to run the applet.


My way Or The Highway: Introduction


David E. Joyce,
John Kennison,
both of the Department of Mathematics and Computer Science,
and Nicholas Thompson,
of the Frances L. Hiatt School of Psychology.
Clark University
Worcester, MA 01610