generic-github-user / Caesium

General-purpose AI library with NEAT-style genetic algorithm.

Home Page:https://generic-github-user.github.io/Caesium/src/versions/javascript/projects/network-visualization/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cs.node constructor function slows down over time

generic-github-user opened this issue · comments

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

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

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.