+/GENN
genetically evolving neural networks
git clone https://git.julia.blue/+/GENN
cc48e92
imdone-todo-updates
1#ifndef GENN_GENOME_H 2#define GENN_GENOME_H 3 4#include "../lib/base64.h" 5#include <sstream> 6#include <stdlib.h> 7#include <vector> 8 9struct Link { 10Link () {} 11 12Link (int a ,int b ,double c = 0 ) { 13input = a ; 14output = b ; 15weight = c ; 16 } 17 18int input ,output ,id ; 19double weight ; 20bool enabled = true; 21 22static bool compare (const Link & a ,const Link & b ) {return (a .id < b .id ); } 23}; 24 25class Genome { 26public : 27int inputs ,outputs ,nodes ; 28double mutationRates [7 ]; 29double fitness = 0 ,adjustedFitness = 0 ; 30std ::vector < Link > structure ; 31 32Genome (const Genome & ); 33 34Genome (std ::string ); 35 36Genome (int ,int ,double []); 37 38std :: string encode (); 39 40void decode ( std ::string); 41 42static bool compare ( const Genome * a, const Genome * b) { return (a -> fitness > b -> fitness ); } 43}; 44 45 46#endif //GENN_GENOME_H