Class: NEAT::Expressor

Inherits:
Operator show all
Defined in:
lib/rubyneat/expressor.rb

Overview

Basis of all expressors.

Expressor object turn genotypes into phenotypes.

Instance Attribute Summary

Attributes inherited from NeatOb

#controller, #name

Instance Method Summary collapse

Methods inherited from NeatOb

attr_neat, log, #log, #to_s

Constructor Details

#initialize(c) ⇒ Expressor

Returns a new instance of Expressor.



8
9
10
# File 'lib/rubyneat/expressor.rb', line 8

def initialize(c)
  super      
end

Instance Method Details

#express!(critter) ⇒ Object

Take the genotype of the critter and create a phenotype from the genotype.

In the phenotype, it creates a function called stimulate(), which is called with the input parameters and returns a response in the form of a response hash (which corresponds directly to the output neurons).

This implementation assumes an acyclic graph (feed forward) and cannot handle cycles at all. Later we may fix this or create a type of Expressor that can.



23
24
25
26
27
28
# File 'lib/rubyneat/expressor.rb', line 23

def express!(critter)
  critter.ready_for_expression!
  express_neurons! critter
  express_genes! critter
  express_expression! critter
end