Class: NEAT::BasicNeuronTypes::InputNeuron

Inherits:
Neuron show all
Defined in:
lib/rubyneat/neuron.rb

Overview

Special class of Neuron that takes input from the “real world”

Name of this neuron equates to the parameter name of the input.

All inputs are handled with this neuron. This type of neuron only has one input – from the outside world.

Direct Known Subclasses

BiasNeuron

Instance Attribute Summary

Attributes inherited from Neuron

#genotype, #heirarchy_number, #output, #trait

Attributes inherited from NeatOb

#controller, #name

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Neuron

#bias?, bias?, inherited, #input?, neuron_types, #output?

Methods included from Graph

#<<, #add, #clear_graph, #inputs

Methods inherited from NeatOb

#initialize, #log, log, #to_s

Constructor Details

This class inherits a constructor from NEAT::NeatOb

Class Method Details

+ (Boolean) input?

Returns:

  • (Boolean)


76
# File 'lib/rubyneat/neuron.rb', line 76

def self.input? ; true ; end

Instance Method Details

- (Object) express(instance)

Takes a single input and passes it as is.



79
80
81
82
83
# File 'lib/rubyneat/neuron.rb', line 79

def express(instance)
  instance.define_singleton_method(@name) {|input|
    input
  }
end