module NEAT::Graph

General graph representation (mainly used for Neurons, but could be used for other structures.)

This is a mixin for Neuron and whatever else you'd like. the contained class is for evaluation, and may be instantiated separately.

Public Instance Methods

<<(input) click to toggle source
# File lib/rubyneat/graph.rb, line 19
def << (input)
  @g_inputs << input
  self
end
add(input) click to toggle source

Add a single input

# File lib/rubyneat/graph.rb, line 25
def add (input)
  @g_inputs << input
end
clear_graph() click to toggle source

clear and initialize the graph.

# File lib/rubyneat/graph.rb, line 15
def clear_graph
  @g_inputs = []
end
inputs() click to toggle source

Get list of inputs

# File lib/rubyneat/graph.rb, line 30
def inputs
  raise GraphException.new "Graph Failure -- input is nil" if @g_inputs.nil?
  @g_inputs
end