Help Me Debug My New Genetic Algorithm AI (plz)!

in #genetic7 years ago

Sah my dudes, so I've recently been trying to build an AI and I decided that a genetic algorithm was best (since it's basic). I have the concept done but I can't seem to figure out build it. I feel like my code is perfect but even after much debugging, it still doesn't work. I would very much appreciate it if you guys helped me. Here's how it's supposed to work:

  1. 2 Random AI are born
  2. Whichever reaches the plant in the fewest amount of moves "wins" and keeps its memory of all the moves it has made, the other AI has its memory wiped
  3. 1 random AI is generated and the AI that had won the last "contest" follows the same path it did last time.
  4. Go to step 2.

However, there are a few bugs that I can't seem to figure out, some help would be awesome!

https://github.com/ninja25538/js-genetic-algo

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.029
BTC 62907.73
ETH 2531.30
USDT 1.00
SBD 2.62