I managed to make the color changing work, it was a formatting issue on the C++ side and parsing issue on the JS side. I did a LOT of reworking on the C++, like storing synapse class members inside of a vector in each neuron class member, which removes the hard limit of 4 synapses for each neuron. So now the simulation can handle unlimited synapses, but the IPC can’t yet. That’s why I started working on having the JS write to- and the C++ read from a JSON file to not have a limit on neurons and synapses. It’s not done yet though. I also started making it more realistic, so I added a Leaky integrate-and-Fire equation which now adds voltage gradually and does constant voltage leaking instead of it just adding and removing voltage in cycles. I also added refractory times to make it more realistic, which determines for how long a neuron can’t fire again, even if there is sufficient voltage. Furthermore, I added synapse weights, since those also affect neuron firings IRL.The JS logic is set up, and it can even write correct data to the JSON, but again, the C++ JSON side isn’t implemented yet, so the video demo is of a slightly older version where I’m still passing in data via the Neutralino API, which is why I’m not showing the different synapse weights in action. Lastly, I did some trial-and-error, and centered the neurons on the canvas when they change color.
Log in to leave a comment