Method: NEAT::Evolver#gen_initial_genes!
- Defined in:
- lib/rubyneat/evolver.rb
#gen_initial_genes!(genotype) ⇒ Object
Generate the initial genes for a given genotype. We key genes off their innovation numbers.
21 22 23 24 25 26 27 28 29 |
# File 'lib/rubyneat/evolver.rb', line 21 def gen_initial_genes!(genotype) genotype.genes = {} genotype.neural_inputs.each do |s1, input| genotype.neural_outputs.each do |s2, output| g = Critter::Genotype::Gene[genotype, input, output, NEAT::controller.gaussian] genotype.genes[g.innovation] = g end end end |