NeuronActivation banner

NeuronActivation

5 devlogs
18h 48m 33s

A realistic interactive simulator of neural circuits. Place neurons, connect them and observe their behavior to different types and sources of stimuli.

tothtamaszeteny

I made a few UI updates, like picture backgrounds, changing the color and text content of the Start button on click, and making the bar of buttons vertical. I fixed the bug where neurons could only be connected in a daisy chain instead of making unique connections. It’s kind of a duct-taped fix instead of finding the root of the issue, but it works just fine. I also setup the logic behind the Start/Stop button and made the NeutralinoJS API start a .exe (written in C++) with Stdin and Stdout so I can send in the starting data without having to try and get the C++ to read a Json file with the info. Also, turns out that I had arrays set up completely well, the console was just lying to me and displaying it in a weird way.
I’m probably forgetting a bunch of stuff, but a lot I’ve been doing besides what I just described is bug fixes.
I hope the video file goes through

Also, I’m pretty sure that the “Screenshots of code (e.g. VS Code) won’t be accepted” warning was added way after I made my first two devlogs of this project, so please forgive me for that, flavortown team….

0
tothtamaszeteny

It’s been quite a while since the last log; I’ve been working on some different stuff, so this devlog is just what I did like 2 weeks ago. I’ve set up a counter for how many neurons there are, and also added the feature to tie neurons together with synapses, though it’s a bit buggy right now. I also now have two arrays, one for X coords and one for Y coords of neurons, which allow me to actually select neurons and stimulate them or add synapses. There is another array, this one multidimensional, which is supposed to have as many rows as neurons on the canvas and have each row store all the neurons that that one neuron is connected to via synapses.

neuronsSynapses.push([]); //add new row to synapses array. (first number is neuron id)

But for some reason, right now it just adds the same numbers to every part of the array. Like if I have 5 neurons on screen, I will have 5 rows and all of them will have numbers 0-5, even if none of them are connected by any synapses. This is one of the more major things I spent time debugging, but I can’t see what I wrote wrong.

On the simulation side, I haven’t done an insane amount of work, I basically just made all classes and members of them global to make working with them easier, because I also now have a second thread acting as a clock, which will call the functions to do one (1) step of simulation each tick.

That’s most, bye.

Attachment
0
tothtamaszeteny

Okay, so I made some basic artwork for the different voltage levels of the neurons, I got an HTML canvas setup and a JS script to make the neuron appear at where I click on the canvas. I still need to figure out how to resize the image in JS or maybe just resize the actual png because it’s way too large right now. I don’t have a pipe between JS and C++ set up yet, but on the sim C++ script front; I have implemented a clock thread that will trigger all the functions in discrete timesteps so it goes level-by-level. I also made a fairly basic simulation function so far, that just loops through all elements of the neuron class (in a vector), check if trigger==true (which means the voltage is >= 10), then goes through all of the synapses of that neuron, checks whether they’re excitatory or inhibitory and adds or removes 2 voltage levels of the neurons connected to it like this:

if(neuron.at(i).trigger == true){
    if(neuron.at(i).synapse1.excitatory == true){
        neuron.at(neuron.at(i).synapse1.sideB).voltage += 2;
    }
    else{
        neuron.at(neuron.at(i).synapse1.sideB).voltage -= 2;
    }

If you couldn’t tell programming is not my strongsuit so far… Now you can lol. That’s about all I have now. Cya

Attachment
0
tothtamaszeteny

Alright, afterall, I ended up switching from WA to NeutralinoJS, because I already have some experience with it. But I’m still doing the backend in C++; which, I’m kinda screwing myself over with, because working with classes in C++ is kinda annoying, like, I have to put all classes in a vector to be able to loop over them, which is annoying and a bit cursed (though this might just be a skill issue on my part). The counter says this devlog will log 2+ hours of work, which would probably be a lot of time for others, but all I’ve managed to do so far is 91 lines of C++ where I set up classes, put them in vectors, assign IDs, and I also have a random number generator function for the signal threshold. That’s really all I can say rn, bye.

Attachment
0
tothtamaszeteny

Alright; devlog. I’m not very good at coding (electronics and cad is more my ballpark), but the best way to learn is to do, so might aswell make something difficult. Right now, I’m thinking about doing this in webassembly, because it’s easy to make an HTML frontend and I can make the backend in C++, which is fast and also the language I’m best at. I have no clue how to do communication between JS and C++, but I’m hoping there’s some easy way in this framework, because I don’t want to deal with pipes, while JSON editing would be insanely slow and inefficient. That’s all for now

Attachment
0