/Smart-Rockets

Smart Rockets w/Genetic Algorithm

Primary LanguageJavaScript

Smart Rockets

Smart Rockets w/Genetic Algorithm

Based on the tutorials from The Coding Train / Daniel Shiffman

https://www.youtube.com/c/TheCodingTrain

https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bw4n02JP28QDuUdNi3EXxJ

https://editor.p5js.org/codingtrain/sketches/BOTCxBDbO

Genetic Algorthim

  1. Create a N sized population of rockets, and give each of them a random gene sequence which is made from vectors.
  2. After running a lifetime calculate the fitness of each member of the population according to their distance to the target and their reaach time.
  3. Generate a mating pool according to the fitness.
  4. Create a new popluation of N members with crossover gene sequence from random selected parents from the mating pool.
  5. Apply mutations to new members.
  6. Return to step 2 with new population.