This project is a simple implementation of genetic algorithm, simulated using Ruby2D graphic library.
Every ship has sensors to detect the surrounding and a randomized neural network. Network controls the ship's movement based on the sensor's reading. Each generation is generated from best performers of the previous generation.
- Collision detection
- Ray casting for sensors
- Neural network layers
- Network visualizer
- Generation system
To get a local copy up and running, follow these steps.
In order to run this project you need Ruby installed on your machine.
Clone this repository to your desired folder:
cd my-project
git clone git@github.com:IndieCoderMM/space-odyssey.git .
Install this project with:
bundle install
To run the simulation, execute the following command:
ruby main.rb
- GitHub: @githubhandle
- LinkedIn: LinkedIn
- Gmail: hthant00chk@gmail.com
- Improve algorithm
- Add shooting mechanic
- Optimize code
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project, please consider giving it a ⭐.
- Self-Driving Car Tutorial: Sensors, collision detection & neural network
- Smart Rockets by Coding Train: Genetic algorithm implementation
- Genetic Algorithm: Genetic algorithm explained
This project is MIT licensed.