Saturday, January 14, 2006

artificial intelligence

for those who are interested, here is a little model that i coded up this week. it's a very simple example of primitive (one neuron) aritificial intelligence in an extremely simple world. you'll need flash to view it:

http://mit.edu/people/lewiston/AI/model_v1.html

the basic premise of the model is as follows:

the yellow object in the middle is a sun, and the white objects are artificial
organisms. each organism is modeled as a two-cell system, one cell for a light-receptive neuron (sensor), and the other cell for a muscle (actuator). the neuron only fires a signal to the muscle when the sunlight-dependent voltage inside the neuron reaches a value above threshold. at this point, the neuron takes a random step to one of the 8 surrounding squares, and the value of the voltage is decremented (to account for the firing). then the voltage has to charge up again before it will fire. the light from the sun decreases relative to the square of the distance of each organism from the sun. therefore, organisms closer to the sun accumulate more voltage quickly, and thus fire more often, resulting in more movement, than those further away. if you watch for a while, you might even see one of the organisms get too close to the sun, go berserk for a few seconds, and then settle down when it gets further away.

there's nothing really remarkable about this model so far, except that all the movement, and any pattern that emerges (like the frequency of movement as related to distance from the sun) is completely derived from the physics of this little pseudo-world. the organisms aren't really doing any independent thinking; they're just reacting probabilistically. given that, i think it's pretty interesting how closely this resembles gnats flying around a light bulb.

4 comments:

AlexPope said...

Is the "line of sight" of each cell to the sun pertinent to much energy each cell will accumulate? Because just watching the activity, it's tough to distinguish a pattern amongst the cells on the outer limits of the grid.

kidpositive said...

how much energy each cell gets is dependent on the cell's distance from the sun. so, the cells around the outer edge should all have slower movement, while those closer have faster movement. however, one thing i've noticed the last few times i watched it is that the area around the sun tends to be sparsely populated. i think this is because cells that close to the sun get really charged up, then fire a lot, which causes them to have a high chance of moving away from the sun. this model is just an idea. the real thing will have so much more to it. i think i'll be posting updates on it as i develop it.

AlexPope said...

I guess I was just thinking there must be some reason as to why all the cells never move exactly the same in their relation to the sun. Some cells on the outer limits would move at a different time interval than those that were of relative equal distance. So I guess I wasn't sure if it was just pure distance, or if the fact that other cells closer, got in the way. Just a thought.

kidpositive said...

it's just pure distance for now. however, where you are depends on how much energy you get from the sun. and then when each cell fires, it moves in a random direction. so, you could have two cells at the same location, with the same energy, and then both fire. one moves closer to the sun, the other moves further away. the one that moves closer will then charge up faster than the one further away.

coding in "line of sight" would be pretty advanced for this model. that'd definitely be something to add in at a later stage, when the aritificial "world" that i've created is much more complex. my next step is to give each cell a "metabolic resource" value. this would be analagous to energy it'd get from food. then, i'd put a bunch of "sugar pellets" in the world. each time a cell passed a sugar pellet, it's resource would increase (because it's eating food). however, every time the cell moves (firing of a muscle which requires metabolic energy), it's resource would decrease. if the cell's resource ever went to zero, it would die. this would be a really good start at trying to create a simple model of natural selection. certains cells would live, while others would die. those that survive would be the ones whose genetic variables (i have a few of these for each cell) are optimal for the environment.