generic-github-user / Caesium

General-purpose AI library with NEAT-style genetic algorithm.
https://generic-github-user.github.io/Caesium/src/versions/javascript/projects/network-visualization/
MIT License
1 stars 1 forks source link

cs.node constructor function slows down over time #98

Closed generic-github-user closed 5 years ago

generic-github-user commented 5 years ago

The cs.node constructor slows down as the evolve function is used repeatedly, leading to poor performance after just a couple hundred iterations.

image

image

generic-github-user commented 5 years ago

The cs.UUID function appears to have slowed down the node constructor as more UUIDs were generated and added to the global ID list. This issue has been resolved by disabling the duplicate UUID check in the function. The probability of a UUID being randomly generated more than once is still extremely low and is unlikely to cause any issues. A new issue has been opened to determine the exact risk of this happening: #99.

image

generic-github-user commented 5 years ago

Since node and connection IDs are local to each network object, they do not need to be added to the global uuids list. The IDs of the networks alone could be added and checked.