This is my take on neural networks moving around in a simple world that gives feedback. When I started this project I had no idea that "neuroid" was already established and really popular within the neural network field, so I named my creatures "neuroids", or "roids" for short, and created a place for them to exist in. The neural network in itself is a simple framework that I have written to explore both neural networks and genetic algorithms. I have gone for simplicity to be able to have as much control as possible and this seems to be enough to get networks that can be trained to perform simple tasks. Everything is written in C and I use GTK-1.2 to do the graphics. The neural network frameworkA neural network is constructed with nodes and connections between these nodes. The connections allow propagation of signals and training information and the nodes themselves act as input-, output- and intranodes.The node has a threshold that dictates when the node is active or inactive. The state of the node changes from inactive to active when the sum of the weighted inputs from the connected nodes is greater than the threshold. The threshold ranges from 0.0 to 1.0 and the sum of the weights for the connected nodes is 1.0 if there is more than one connection. Adding connections to an initialy unconnected node follows a certain pattern regarding wieghts that I think is interesting.
The nodes are inserted into a structure that, mainly, consists of three sets: in_nodes , out_nodes and nodes . All nodes in in_nodes and out_nodes are also members of nodes . There is also information about which node is connected to which node to facilitate for the genetic algorithms to modify the networks.Training of a network is done in an as straightforward way as possible by adjusting the weights and/or the threshold of a node to make it more likely to give the desired output in the future with regard to the current distribution of weights in the node and the state of the connected nodes.
The roids and the world that they inhabitWith the framework ready it is easy to construct networks that can handle a simple world and react on the stimuli that they are provided with. In this case a fully connected network with 20 inputnodes and 4 outputnodes is present in every roid. The roid will get information about the following:
![]() The 15 red roids move around and they can see eachother, yellow food, green trees and blue water. The border of the inner drawingarea is reported as a wall. To make things a bit more interesting the roids are punished for their existance with regular intervals making it a good thing to find food to be the last living roid and get a shot at propagating your neural network to the next generation. A roid "eats" by passing through food and getting one more hitpoint each time it happens. When the dust has settled one roid is still alive due to eating more than his fellow roids and thus being able to sustain more beating: ![]() |