Nina + valentina
From KokkugiaWiki
We are looking at the travel patterns of neurons and how they communicate through the brain.
Traditionally, it has been thought that the brain cells communicate by switching on and off yet that is too simple to account for everything they do. Scientist have come to feel that neurons have lives of their own. David Terman, professor of mathematics at Ohio State has done a lot of research on the topic.
Terman continued: “A common way to think about neurons is that one cell fires off a signal that excites its neighbors, and the neighbors fire off a signal and so on, in synchrony with each other, but real communication is more complex than that. One of the questions we’re confronting is how the brain produces smooth, synchronous wave patterns when the cells sometimes fire in an asynchronous way.”
Our goal with this script is to capture this smooth, synchronous pattern that ignites movement and thought. Codes that we are taking for inspiration from this are the pheromones and other node attraction devices. the electric charge is the agent in this situation, illuminating the neuron and invigorating it.
import kGeom.*;
import kRender.*;
kSpace space;
brain brain1;
int envSize = 250;
void setup(){
size(500,500,P3D);
brain1 = new brain();
space = new kSpace(this);
space.cam.jump(-600,-550,-500);
// loop to make random neurons
for(int i = 0; i < 100; i++){
brain1.addNeuron(new neuron(new kVec(random(-envSize,envSize), random(-envSize,envSize), random(-envSize,envSize))));
}
}
void draw(){
background(100);
brain1.run();
brain1.render();
space.render();
space.init();
}
void mouseDragged(){
space.mouseDragged();
}
// brain
class brain{
ArrayList neurons;
ArrayList electrons;
ArrayList connectList;
//constructor
brain(){
neurons = new ArrayList();
electrons = new ArrayList();
}
void run(){
// loop for neurons
for(int i = 0; i < neurons.size(); i++){
neuron n = (neuron) neurons.get(i);
n.update(neurons);
}
// loop for electrons
for(int i = 0; i < electrons.size(); i++){
electron e = (electron) electrons.get(i);
e.update(electrons);
}
}
void render(){
// loop through every neuron and render
for(int i = 0; i < neurons.size(); i++){
neuron n = (neuron) neurons.get(i);
n.render();
}
}
// add electron
void addElectron(electron e){
electrons.add(e);
}
// add neuron
void addNeuron(neuron n){
neurons.add(n);
}
// remove electron
void removeElectron(electron e){
electrons.remove(e);
}
// remove neuron
void removeNeuron(neuron n){
neurons.remove(n);
}
}
// electrons
class electron{
int neuronNumber;
float magnatude;
electron(int _neuronNumber){
neuronNumber = _neuronNumber;
}
void update(ArrayList electrons){
}
void update(){
// find neuron neighbors
// make a decision to move to another neuron
// update neuronNumber
// depleate magnatude
}
void decreaseMagnatude(){
}
}
// neurons
class neuron{
kVec pos;
ArrayList connectList;
int numberOfElectrons;
float connectThreshold;
// constructor
neuron(kVec _pos){
pos = _pos;
connectThreshold =100;
}
void update(ArrayList neurons){
makeConnections(neurons);
}
// make connections
void makeConnections(ArrayList neurons){
// work out what to connect to and update the connectList
// loop through all the neurons and connect if within a certain distance
connectList = new ArrayList();
for (int i = 0 ; i < neurons.size(); i++) {
neuron other = (neuron) neurons.get(i);
float dist = pos.distance(other.pos);
if ((dist > 0) && (dist < connectThreshold)) {
connectList.add(other);
}
}
}
void render(){
// loop through every connections and render
for(int i = 0; i < connectList.size(); i++){
neuron other = (neuron) connectList.get(i);
kLine ln = new kLine(pos,other.pos);
space.append(ln); // this could be a problem
// space.append(new kLine(pos,other.pos));
}
kVec pt = kVec.clone(pos);
pt.setColor(255);
space.append(pt);
}
}
