Sha256: 994eee68ed133b6365757213e7b0095868e9f9ef76b4102ff0c40753e8b0a6d0

Contents?: true

Size: 435 Bytes

Versions: 2

Compression:

Stored size: 435 Bytes

Contents

require "ga/version"
require "ga/zoo"

module GA
  def self.included(cls)
    cls.extend(ClassMethods)
  end

  def <=>(target)
    fitness <=> target.fitness
  end

  module ClassMethods
    def new_ga_zoo
      GA::Zoo.new(self)
    end

    def evolve(total_units = 32, generations = 100, crossover_rate = 0.8, muration_rate = 0.1)
      new_ga_zoo.evolve(total_units, generations, crossover_rate, muration_rate)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ga-0.1.2 lib/ga.rb
ga-0.1.1 lib/ga.rb