
Show HN: Small project on particle animation, genetic algorithms and plain JS - denomer
https://github.com/dg92/ant_sugar
======
mfazalul
I've been running it for some time now and it seems that the model started to
converge towards generation 35 and then diverged after that. i.e. since you
consider the loss to be distance from each particle to the food, then the ants
ended up somewhat above the food at 35, and then started overshooting it after
that. Is that expected behavior?

~~~
denomer
no, if it reaches food, each generation after that should follow the same
path.

Thanks for pointing out. I will debug and update :)

~~~
denomer
However, all ants will not follow the same path but most should.

~~~
mfazalul
I did not expect all the ants to follow the same path, but I thought maybe
they'll come close since only the best generations are supposed to get passed
on with mutations. I'm at generation 810 and the model hasn't improved much.
Most ants (except for ~6) first go to the right to avoid the obstacle, and
then they travel to the upper-left corner while about 6-8 reach the food.

I hope it would work better with minor tweaks to calculating the loss and
selecting new generations :) Good Luck

------
razeonex
I think this is part of "Nature of Code" MOOC. I have a similar visualization
on my website: [https://raze.mx](https://raze.mx) :)

