


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



In this assignment you will use a genetic algorithm (GA) to evolve rules for a SIR CA that maximizes the fitness of a virus. You may work in pairs. The CA The CA has 4 states: (0= EMPTY, 1= SUSCEPTIBLE, 2=INFECTED, 3=RECOVERED). One rule set for such a CA is described in Assignment 1, part 2.2. There are constraints on the transition rules such that the cells have a predetermined cycle of states; they can go from 0 ‐>1 ‐> 2 ‐> 3 ‐>0, so that cells can potentially cycle indefinitely. Assignment 1 Rule Set 2 gives one set of transition rules:
The GA Sample Matlab code for a GA (created by George Bezerra) is posted online. That code uses tournament selection, mutation and 2 point cross‐over to evolve a string with the maximum number of ones. You may start with this code and modify it, or you may find other code online, or you may write your own. Your GA should evolve a string which forms the rule set of the CA described above. Your fitness function ( f ) is simply f = I , where I is the number of new infections produced over a run of the CA. That is, you should calculate the fitness of the string by passing that string to your CA, running the CA, and measuring the number of infections produced. Be aware that you cannot simply add up the number of infected cells at each time step. If a cell is infected for 10 time steps, it only counts as 1 infection. I is the number of transitions from state 1 to state 2. You can use that raw value as your fitness function, and with tournament selection there is no need to normalize the fitness values (e.g. if 1700 infections occur using the rule set encoded by string1, then f (string 1 ) = 1700.) This approach is valid if you run the CA with a fixed grid size for a fixed number of iterations for each run of your GA. You will want to run your CA as efficiently as possible (with no extraneous functionality like displaying the state of the CA to the screen), since you will have to run the CA many times for each tournament for many generations of the GA. Initial conditions Initialize your CA with a fully susceptible population with no empty spaces, and all cells in state 1, EXCEPT, set 8 cells in a row in the center of your CA to be infected. This represents a new virus infecting a fully susceptible population. (You need 8 initially infected cells in order to allow B to equal any value up to 8.) Set your CA to a 20x20 grid. The number of iterations is up to you, but be sure to run your CA long enough for new births to significantly increase the number of infections (without births, there are only 400 possible infections no matter how long you run the CA.) First initialize your GA by following suggestions made in Dr. Forrest’s lecture for the size of the tournament, the number of generations for the GA, mutation rates and cross over rates (given that you have a small string of only 12 bits).
Your report should be no more than 10 pages of text, excluding code and figures. Figures should be embedded into your report, and you should include a printout of your code as an appendix. The report should include the following:
Email your reports to [email protected] on March 31. Your grade will be determined by a) whether you correctly implemented your CAs and GAs and fitness functions (25%) b) the creativity of your solutions in experiments 2, 3 and 4 (25%), the fitness of your evolved CA’s (10%) the clarity and quality of your report (40%).