class NEAT::Neuron
Neuron
– Basis of all Neat Neuron
types.¶ ↑
Normally contains primatives which aids in its own expression, but the details of this remains to be worked out.
Attributes
genotype[R]
Genotype to which we belong
heirarchy_number[RW]
(assigned by wire!) Heirarchy number in the Genome / Critter
We need this to assure we add genes in the proper order. This will be recalculated every time a new neuron is added.
output[RW]
This is true if this is an output neuron.
trait[RW]
Public Class Methods
bias?()
click to toggle source
# File lib/rubyneat/neuron.rb, line 43 def self.bias? ; false ; end
inherited(clazz)
click to toggle source
# File lib/rubyneat/neuron.rb, line 49 def self.inherited(clazz) @@neuron_types << clazz end
input?()
click to toggle source
Class is is of Input type?
# File lib/rubyneat/neuron.rb, line 40 def self.input? ; false ; end
neuron_types()
click to toggle source
List of distinct neuron types (classes)
# File lib/rubyneat/neuron.rb, line 54 def self.neuron_types; @@neuron_types ; end
type_name()
click to toggle source
Type names must always be unique for Neurons. TODO: Enforce uniqueness in neural type names
# File lib/rubyneat/neuron.rb, line 35 def self.type_name @type_name ||= self.to_s.split('::').last.split('Neuron').first.downcase end
Public Instance Methods
bias?()
click to toggle source
# File lib/rubyneat/neuron.rb, line 44 def bias? ; self.class.bias? ; end
express(instance)
click to toggle source
Function must be implemented by subclasses for phenotype generation. Basically, an instance is passed to this function and it will add a function to sum all inputs and a apply an operator to the sum.
# File lib/rubyneat/neuron.rb, line 60 def express(instance) raise NeatException.new "express() must be implemented by subclass." end
input?()
click to toggle source
# File lib/rubyneat/neuron.rb, line 41 def input? ; self.class.input? ; end
output?()
click to toggle source
Instantiation is of outout type?
# File lib/rubyneat/neuron.rb, line 47 def output? ; !!@output ; end