lib/rubyneat/evolver.rb in rubyneat-0.3.5.alpha.6 vs lib/rubyneat/evolver.rb in rubyneat-0.4.0.alpha.3
- old
+ new
@@ -1,7 +1,8 @@
require 'rubyneat'
require 'distribution'
+
module NEAT
#= Evolver -- Basis of all evolvers.
# All evolvers shall derive from this basic evolver (or this one can be
# used as is). Here, we'll have many different evolutionary operators
# that will perform operations on the various critters in the population.
@@ -81,10 +82,10 @@
# is c1.fitness <=> c2.fitness. You may elect to evaluate them differently.
def prepare_fitness!
@npop.species.each do |k, sp|
sp.sort!{|c1, c2|
unless @controller.compare_func.nil?
- @controller.compare_func.(c1.fitness, c2.fitness)
+ @controller.compare_func_hook(c1.fitness, c2.fitness)
else
c1.fitness <=> c2.fitness
end
}
end