// Scenesaver: copyright 2003 Sam Stafford. class DNA; struct Neuron { float axon; float thres; Neuron* dendrite[4]; float weight[4]; float x; bool active; }; struct Lobe { Neuron neur[2][4]; }; struct BigNeuron { float axon; Neuron* dendrite[24]; float weight[24]; }; class Brain { public: Brain( DNA*, float* ); ~Brain(void); void CheckActive( Neuron* ); void Clear(); void Fire( Neuron* ); void Fire( BigNeuron* ); void Render(); void RenderLights(); void RenderSyn( float weight, Neuron* n1, float y1, float x2, float y2 ); void RenderNeuron( float axon, float x, float y ); void Think(); Neuron input[14]; //this gets fed from outside Lobe lobe[6]; BigNeuron output[4]; float *muscles; }; //Neuron inputs: // 0 Nearest-food unit vector (x component) // 1 Nearest-food unit vector (y component) // 2 Strongest-DR unit vector (x component) // 3 Strongest-DR unit vector (y component) // 4 Strongest-DG unit vector (x component) // 5 Strongest-DG unit vector (y component) // 6 Strongest-DB unit vector (x component) // 7 Strongest-DB unit vector (y component) // 8 Nearest-creature uvector (x component) // 9 Nearest-creature uvector (y component) // 10 Current velocity vector (x component) // 11 Current velocity vector (y component) // 12 Dfitness from food consumption // 13 Dfitness from flocking pattern //Muscle outputs: // 0 X acceleration // 1 Y acceleration // 2 Speed change // 3 Angle change
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 4448 | Sam Stafford | Turn this thing into a Windows screensaver. | ||
#3 | 4440 | Sam Stafford | Bug fixes, new features, the usual. | ||
#2 | 4433 | Sam Stafford |
More work on this little project. The AI is still nonexistent. |
||
#1 | 4430 | Sam Stafford |
Start importing alife/AI code from Genesaver. Much tweaking will need to be done. |
||
//guest/sam_stafford/genesaver/src/Brain.h | |||||
#1 | 3052 | Sam Stafford |
Add Genesaver to the Public Depot. It's not in any way Perforce-related, but it does share a bit of code with Jamgraph, and it feels strange to have an open-source project that's not in the PD. |