This was done for my 💻CS20A Final Project. Why? Idfk either.
Ships are blue(alive
) and red(dead
) circles and asteroids are grey circles. The Engine attempts to learn to avoid asteroids using a genetic algorithm, and a custom coded network.
Note that the network modifies edge weights
rather than node weights
, since it was easier to program and I felt lazy that day. 😴
Okay enough emojis here's a picture:
The program still has some bugs, since it was created in a rush (kind of), fix them if you want ig? I might fix them later. I might not.
Bug | Predicted Location | Status |
---|---|---|
Packages are not setup correctly | All files |
Project was created on repl.it 💀, so packages are setup wrong- not a hard fix though |
Asteroids get stuck on edges/go off screen | Asteroid.java, in update() |
Bug is likely caused by asteroids being out of bounds for 2 updates and switching back and forth over and over |
Genetic Algorithm assigns by reference | Learner.java, Line 37 |
Assigns networks to the worse half by reference, meaning only 15 agents show up, the others are just duplicates |
👍 Potential Improvements: Boundraries kill ships, rework ship AI to move more constantly, address overfitting.
If you just want to try it, you can view the replit here. If you want to play around with the project, I suggest forking this repo and moving the code into a working JavaFX environment.
🕐 Hours wasted using replit: 10-20
yeah that's it