Skip to content

Using genetic algorithm (from PyWorld) to create an ocean simulation where fish get stronger as time goes on

Notifications You must be signed in to change notification settings

bradwyatt/GeneticAlgorithmFishSimulation

Repository files navigation

Genetic Algorithm Fish Simulation

The goal (dependent variable) is for the population of red fish to evolve by developing traits that will help them survive for a longer period of time before being eaten by sharks.

  • The strongest 50% of each fish population mate, while the weakest are eliminated from the gene pool. The blue fish are the top 2 fish from the previous generation.

  • The variables I created includes field of vision (the arc each fish can ‘see’ a shark), size, speed, intelligence (does the fish move away from a shark as it enters the arc), and frequency of turns.

As a result, The fish last longer before being eaten as time goes on.

Observing Fish Generations Over Time

Generation 0 (START)

Start of the simulation:
  • The Top 50% output (to the left) was produced after the red fish were all eaten by sharks
  • The red fish with the highest scores have very random traits

Generation 48

Compared to previous generations:
  • Size tends to decrease
  • Speed is very slow
  • Radius arc slightly higher
  • Intelligence slightly higher

Generation 241

Compared to previous generations:
  • Size slightly increases
  • Speed remains slow
  • Turn frequency significantly higher
  • Intelligence very high

Generation 909 (MAX)

Compared to previous generations:
  • Size extremely small
  • Speed very slow
  • Big radius arc
  • High intelligence

References

Genetic Algorithm code was from https://github.com/HanaAuana/PyWorld (initiation of DNA in objects)

About

Using genetic algorithm (from PyWorld) to create an ocean simulation where fish get stronger as time goes on

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages