Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 1.05 KB

README.md

File metadata and controls

4 lines (3 loc) · 1.05 KB

neuroevolution-car-thingy

It is a simulation of cars driving around a primitive track and the way it learns is called neuroevolution.

the script basically just takes a lot of cars then makes them drive around the track and then picks the best car based by the distance to the destination point and then makes copies of that and then modifies them a bit and rinse and repeat. to run just put: python3 game.py after 100 gens then the script just shows the best car for 1000 times and then quits. i left plenty of comments in the code so that to make it so that it doesn't try to show the evolution cars going around the track then you can just comment the huge block before the final part where the number of cars is set to one. and the section before the now-commented section you should get rid of the comments and it should do the neuroevolution without the graphical turtle interface, but it still shows the best car after 100 gens. the fitness calculation also takes into account the amount of time it took to get there (after it has made it to the end atleast once).