Lab 14

docx

School

University of Illinois, Urbana Champaign *

*We aren’t endorsed by this school

Course

MISC

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

5

Uploaded by DeanLemur3560

Report
Lab 14: Human Nature Jenna Makropoulos, Michael Albrecht, Kaela Maghinang Evolutionary Simulation Go to https://rednuht.org/genetic_cars_2/ . It is recommended you use the Firefox browser if you have it. You will see that it is a simulation of “cars'' driving along a bumpy landscape. The further the cars get the bumpier the landscape gets. Each car drives until it gets stuck. The winning cars are the ones that get the farthest in the landscape. Each car has a set of “genes” that specify physical traits that affect its performance. They are: Shape (8 genes, 1 per vertex) Wheel size (2 genes, 1 per wheel) Wheel position (2 genes, 1 per wheel) Wheel density (2 genes, 1 per wheel) darker wheels mean denser wheels Chassis density (1 gene) darker body means denser chassis In the simulation, the cars that do a better job driving further get copied into the next generation, and the losing cars do not get to make copies of themselves. The number of winners copied is altered by the “Elite clones” option. If set to 1, the 1 winner of each race will be copied to the next generation, and the other 19 are generated randomly. Alternatively if you set it to 10, the top 10 performers are copied and the remaining 10 are generated randomly. You can control various properties of the simulation using the options on the top right: Mutation rate: chance that a reproduced copy of a car changes one of its genes Mutation size: if a mutation occurs, how big of a difference is it from the parent Floor: whether the floor is the same every time, or changes Gravity: how much gravity there is “Create new world with seed”: this allows you to type a number to generate a specific random world. It is a way to guarantee that you can replicate a specific world if you want to. After setting the program parameters how you want, clicking the “Go” button will restart the simulation using the parameters you have chosen. In the plot right below the visual display, you can see the performance (in terms of distance achieved) of the best car (red), top 10 cars (green) and all 20 cars (blue) over time. Below that, you see a depiction of the 20 cars in each generation. You can speed up the simulation using the “surprise” and “fast forward” buttons. Surprise disables the visual display at the top (but you still see the cars race in the figure below. The “fast forward” button jumps to the end of that generation (having simulated the winner quickly offscreen) and goes ahead to the next generation. So if you press the fast forward button repeatedly, you can quickly jump through the generations. But be careful about clicking it too fast, that sometimes crashes the simulation. So wait a second between each click and make sure you see the next generation begin before clicking it again. You can pause the simulation by clicking the “Go” button. This will open a window asking if you want to reset the simulation. If you hit cancel, the simulation will resume. 1. Change “Create new world with random seed” to 1, and make sure that you set the following values: ground: “fixed” gravity: “earth” Elite_clones: 1
Lab 14: Human Nature mutation rate and size: 0% Then click the go button and run the simulation for at least 50 generations (remember you can speed through them by using the Surprise button, you don’t have to watch them all). a. What kind of car tends to do the best over time, and how far is it getting? Is its performance continuing to improve with each generation, or has it seemed to have hit a peak in its performance? Why do you think this is happening? i. The car has two large wheels in comparison to the body, where the front wheel is bigger in size than the back wheel. The body of the car is ridged, which is most likely to help the car rotate in a direction that results in it landing back on its wheels after hitting an edge in the road. ii. The performance of the car increases until it hits a peak in which its performance is maximized, and then the performance ceases to improve any more. This is likely because once the car achieves a model that is the best, adding too many alterations will not improve the performance any more. b. Is the car that did the best doing in your simulation similar to the one that is doing best in the simulation for the other people in your group? Explain why you think this might be happening? i. I think we all had similar cars, especially with the size of the wheels - with the front wheel being bigger than the back wheel. However, the shape of our cars differed slightly, but all were rigid and irregular in shape. ii. This might be happening because the environment is slightly variable in each trial. The main shape and wheel type of each of them are the same, but not exactly the same. This is because since each environment is random, there are slight possibilities that the shapes of each of the cars are different depending on the slight changes in the environment. c. Describe what’s happening in terms of the algorithm of natural selection. Make sure to reference all three components of the algorithm. The algorithm of natural selection is taking the genes of the top performing car and passing them down to the next cars. i. Mutation rate: The mutation rate being 0% means the top 10 cars of the next round are all the same as the previous winning car, which means if that car is the most fit it will continue to win. ii. Mutation Size: The mutation size being 0 means that the cars for each new population will not vary much and will continue to be similar to the first car. iii. Elite clones: The elite clones being 1 means that only the very best car’s genes will be passed on. 2. Now change the mutation rate and size to 100%, click the Go button (restarting the simulation) and run for at least 50 generations. a. How did the results compare? i. The scores of all of the cars were significantly lower than the scores of the cars in the past simulation. The cars are not able to move across the terrain and the shape of the cars are totally different. The wheels are abnormally big and the shapes are still rigid, but are all different from each other. b. Your results were probably worse. Why? Explain how the performance differed in terms of the evolutionary algorithm.
Lab 14: Human Nature i. The results were worse because every generation, the cars will always mutate, meaning that the car that wins the race will pass on its genes to the next generation. However, since the mutation rate is 100% and the cars will ALWAYS mutate, that means that the genes that were supposed to get passed to the next generation will not end up benefiting the next cars because they will change and mutate. c. If you change the number of elite clones to 10, will this change its performance on average? Don’t try it. Think it through from first principles. If you got the answer to 2b right, you wont need to simulate it to know what will happen. i. Nothing will change its performance because it will essentially be like starting the population over and over again. The cars that will win will end up mutating out those winning genes and start a whole new car type. 3. You can think of the mutation rate (and size) and the number of copies as factors changing how natural selection can “search” through the space of possible cars, trying to find the one that is the best fit for the environment. a. How does the mutation rate and size affect this search process? What is a good mutation rate? Again, don’t use the simulation, try to make a guess by thinking through the process. i. Mutation rate and size has the ability to change the model too much, where the models in between generations are not passing down any of the traits from the previous generations, or the traits are being altered too much. It may be best to have a low mutation rate, where there can be regulation and a lot of genetic variation to maintain the best fit traits or select improved ones. I would guess somewhere between 5%-20% for a mutation rate. b. How does the number of elite clones affect this search process? What is the optimal number if you are trying to find the best car quickly? How does the search differ if the number of elite clones is 1 vs 10 vs 20 (the simulation doesn’t let you do 20, but you can imagine). i. The number of elite clones affects how many of the top scorers move onto the next generation. If you want the best car quickly, it is best to choose maybe the top 5 to 10 cars. This is because if you choose only the top winning car, then the whole population after this will only be the phenotype of the historically top car and any variation after would have to be due to mutations. This may be bad because if the environment changes, then this car will not be able to withstand the changes due to its lack of variability. However, if there are a few top cars then there is a higher chance of the best one coming out. c. In your group, come up with a set of hypotheses about the best set of mutation and elite clone parameters, and test them by having each member of your group use different settings to evolve a population for 50 generations. Which one did best and how well did it do? i. Hypothesis 1: mutation rate and size: 20%, elite clone parameters: 4 1. #1: 172.3 d:167.07 h:-5.36/4.92m (Gen 45) ii. Hypothesis 2: mutation rate and size: 10%, elite clone parameters: 5 1. #1: 160.07 d:155.81 h:-6.34/3.1m (Gen 13) iii. Hypothesis 3: mutation rate and size: 5% elite clone parameters: 3 1. #1: 160.6 d:156.06 h:-6.43/2.3m (Gen 44) 4. Now we want to think about the role that environmental variation plays. a. Without restarting your simulation, think about what happens if you change the floor variable from fixed to “random” (meaning that each generation the floor changes). Do you think the population that you have trained so far on floor 1 do better or worse, on average? Why?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Lab 14: Human Nature i. I think that it would do worse on average because the shapes of the cars and the types of cars were selected based on that specific floor and environment. If you change the environment, you are putting a certain type of car in a new environment where its past beneficial traits/mutations will not be able to benefit their survival in this new environment. b. Alternatively, consider that you changed the gravity setting to a different planet. Do you think the population that you have trained so far on floor 1 do better or worse, on average? Why? i. Again, those cars would do worse because we are putting them in a different environment that they are not adjusted to or have the beneficial mutations that had them at an advantage on their original environment. Because of this, the cars would do worse on average as the car types will not be adjusted or adapted to the new gravity. Change your settings to the following: ii. Mutation rate: 5% iii. Mutation Size: 50% iv. Elite clones: 5 v. Gravity Earth The TA will now divide the class into two groups, A and B. Group A will be training cars with the floor set to fixed, and each group member will use a different random seed. Person A1 will do random seed 1, A2 will do random seed 2, and so on. Members of group B will set their floor to mutable, meaning that the floor will be randomized each time. c. Before we start, which group do you think will perform best, on average. Why? Now run the simulation for 50 generations. Then pause the simulation and have everyone report their results. Which group did better, on average? Group A will most likely do better since their generations are passing down information and adapting to a constant environment. Group B was better on average, possibly because of the way the random smoothness of the floor was per generation. If the car was better fit for the random environment, then it was more successful. In group A, there were challenges that new generations were struggling to overcome in the environment, but group B would be able to overcome challenges because it adapted to multiple different environments. d. Next, switch groups. If you were in group A, change the floor to mutable. If you were in group B, change it to fixed (meaning it will repeat over and over whatever floor it had done last). Which group do you think will do better? Why? Group B will most likely do better than Group A because it can now focus on a single environment and its selective pressures will now be fixed. As a result, the subsequent mutations that lead to beneficial outcomes will be tailored to that environment and will get better over time. This reflects what happens with Group A in the first part of this experiment. Because the environment is not changing, the most beneficial phenotypes gained through mutations will continue to get passed down until Group B has the most beneficial phenotype for that landscape. Group A would not do as well because their phenotype was only based on the single fixed floor it had before. Once you put it in an entirely new environment, it will fail to have the traits that help it perform better.
Lab 14: Human Nature e. Now run the simulation for 50 generations and report the results. Did the result match your hypothesis? Group A did better than Group B when the floors were changed. No, the results did not match our hypothesis, because the increase in scores seems to actually be dependent on whether the floor is mutable.