You are on page 1of 11

Evolution System

Eden Weizman 6/10/12

Assignment P1: Create a population of colored circles. Those closest to a specified color will have a greater probability of survival. Make them to evolve. Your evolution should follow the evolutionary principles in your text, and you should be able to calculate Hamming distances. (Due 6.10.12)

Instructions for Use Upon opening the program, the user will be prompted for several parameters. These parameters are Goal Red Value, Goal Green Value, Goal Blue Value, Max # of Individuals, Selection Parameters, Variation Parameters, Probability for Crossing Over, and Crossover Points.

The red, green, and blue values will be composited to create a target color using standard RGB format. Red, green, and blue each use 8 bits. The individuals that are this target color or closest to this target color are the ones most adapted to their environment and most likely to survive and pass on their chromosomes. This adaptation level, or fitness, will be determined by comparing each of the 24 bits of an individuals chromosomes to the 24 bits which comprise the determined target color. Each bit that is the same will increase the individuals fitness level by one. The maximum number of individuals is the biggest that the population can be. Selection parameters determine who will comprise the next generation. If 1 is inputted, each new generation will include only the offspring. If 2 is selected, the next generation will include both parents and offspring. The population will be determined via roulette wheel which will accept no duplicates. Essentially, individuals with higher fitness have a proportionately higher chance for survival. The variation parameter determines the chance that each bit of an offsprings chromosomes will be mutated when it is created. At the beginning of the reproduction stage, pairs are determined by a roulette wheel which does accept duplicates, so some individuals will have more than one chance to pass on their genes. Probability for Crossing Over determines

the chance that each pair will have to combine their genes. If they do no, both parents will remain in the population so that population size will stay stable. Crossover points determine where the chromosomes of two individuals will cross over when combining their genes during reproduction. A specific point can be chosen by simply writing a number from 0-24. Multiple points can be added by inputting multiple numbers from 0-24 with spaces in-between them. A random point can be selected by inputting -1. After pressing go, the initial population and the goal color will be displayed in new windows. Windows may be on top of each other. Each individual is displayed as an oval filled with its color. The larger the oval is, the more fit it is.

The program will run until one individual reaches the target color. Then another window will open containing the final population. The amount of generations it took to reach this result is displayed in the heading, circled here in red.

System Behavior as a Function of Parameters Trial 1: Control

The second and third trials ran for 420 and 184 generations respectively.

Control Graph
30 25

20 Average Hamming Distance Best Hamming Distance 10

15

0 0 50 100 150 200 250 300

Trial 2: Varying color

Varying color did not make much of a difference, taking 232, 310, and 140 generations on average to reach the final goal. This is because the original starting

colors of each individual is random, thus the distance each member is from the target color is random as well. Trial 3

Here the maximum number of individuals was varied. It took only 45, 56, and 84 generations. There were more individuals and thus a greater chance to be closer to the target color and much more variety. Thus it took a lot less generations. Trial 4

The selection parameters were varied. It took only 167, 203, and 196 generations. This is much less than the control. This is because if a parent is especially fit, it does not need to be excluded in the next generation. More selection means better chances. Trial 5

The probability of mutation was increased. The change was drastic, and it took 1774, 3097, and 15,665 generations to reach the target color. This is because at this point, the chance was too high for each bit to be mutated. Even if two especially fit individuals got together to create a fit offspring, the mutation would be frequent enough to just take that offspring further and further from the end result. It may be noted that even though some individuals did reach the target, the majority of individuals and the average fitness is still very low. There is much more variety in this population. Trial 6

The probability for crossing over was increased. It took 364, 45, and 167 generations. This is more spread out than the other trials. A possible reason for this

is that the more crossing over there is, the more chance and variability is introduced, making the end result more random. Trial 7

The probability for crossing over was lowered. The final populations were notably more consistent than in any of the other trials, meaning a much higher average fitness level. From this it can be concluded that the less crossing over there is, the less variance there is within the population. This backs up the conclusion to the previous trial. Trial 8

The 2nd and 3rd trials yielded 143, and 149 generations. Here the crossover point was made random. This yielded more variety.

Trial 9

Additional trials took 108 and 110 generations. This time there were 2 crossover points used, dividing up the chromosomes into three equal sections, being divided up at 8 and 16. More crossover points meant more mixing up of genes which means more variety. More variety and theres a higher chance that one individual will hit the target.

You might also like