- Agents now earn the maximum score by sticking to the blue circle of the target
- All vector quantities (velocity, position) given to the agent are represented in polar coordinates to speed up evolution
- Agents are given the angle of their velocity and the
- 2 memory slots are added that the agent can read/write to
- Restyled webpage
- Added
draw players
checkbox to speed up training - Added save/restore functionality to localstorage
- Changed a few GA settings (elitism & mutation rate)
This repository shows how you can use Neataptic to succesfully teach neural networks to trace targets. You can see the genomes live in action here. These genomes have been trained for over 100 generations and are very effective. Visualisation done with P5.js. The next step would be adding collisions, to possibly reveal some interesting tactics.
Read an article on this repo here.
These forks of this library are interesting to check out as well:
- corpr8's fork gives each neural agent its own acceleration, as well as letting each arrow remain in the same place after each generation. This creates a much more 'fluid' process.
If you manage to optimize the settings, please perform either a pull request or create an issue here.
WIDTH
set the width of the playing fieldHEIGHT
set the height of the playing fieldMAX_SPEED
set the maximal multiplier speed a genome can have (smaller genomes move faster)START_X
set the x-location from which each genome (and the target) startsSTART_Y
set the y-location from which each genome (and the target) startsSCORE_RADIUS
set the distance to the target from where genomes get assigned scorePLAYER_AMOUNT
set the amount of genomes that play on the field (population size)ITERATIONS
set the amount of iterations/frames each generation is tested forSTART_HIDDEN_SIZE
set the amount of hidden nodes each genome starts witchMUTATION_RATE
set the mutation rateELITISM
set the amount of elitism