Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (39 loc) · 2.53 KB

README.md

File metadata and controls

46 lines (39 loc) · 2.53 KB

Evolution

Copyright (c) 2019 Austin Baugh

Evolution is a 2D simulation based on Daniel Shiffman's coding challenge of implementing Evolutionary Steering Behaviors.

  • This simulation is written in the Rust programming language, and uses the ggez crate.
  • This simulation consists of fish who improve their survival behaviors through the use of a genetic algorithm.
    • The fish should be inclined to be attracted to food/prey and repelled by predators
    • The fish should also develop perception radii for prey and predators respectively that works mostly optimally.
  • The fish reproduce asexually by cloning themselves, with the possibility of their gene's mutating (mutation rate).
  • The speed of the fish is inversely proportional to their size.
    • Therefore larger fish will be slower, while smaller fish will be faster.
  • Since there are predators in this simulation, their are different groups of fish, depending on their link in the food chain.
    • Different fish groups have different ranges of sizes/speeds.
    • E.g. The highest-levelled group in the food chain (the group of predators that can't don't have predators) will have the largest size options and smallest speed options.
    • E.g. The lowest-levelled group in the food chain (the group of fish that isn't predators) will have the smallest size options and largest speed options.

Build and Run

This program requires cargo, which can be installed here. I advise using the --release argument when building or running to achieve a higher FPS.

  • Build: cargo build --release
  • Run: cargo run --release

Features

  • Animate fish in a throughful way
  • Add seek behavior to fish
  • Add a declining health attribute to fish
  • Add food entities
    • Have fish seek food
    • Have eating food replenish lost health
  • Implement predators
    • Have fish avoid predators
    • Have fish seek prey
    • Have eating prey replenish lost health
  • Incorperate cloning
    • Apply a mutation rate in the cloning function

License

This program is licensed under the MIT License

Additional References