RubyGems Navigation menu

charlie 0.5.0

DESCRIPTION: Charlie is a library for genetic algorithms. It allows you to easily create and run genetic algorithms. You can choose selection, crossover or mutation strategies from either built-in options or simply write your own. It also includes methods that can be used to compare several of these strategies, generating reports with statistics that can be used to determine which one to use in future problems. == EXAMPLES: This example finds the binary representation of the number 512. require ‘rubygems’ require ‘charlie’ class Find512 < BitStringGenotype(10) # choose a genotype, in this case a list of 10 bits represents a solution # Define a fitness function. This one returns minus the offset to the best solution, so a higher number is better. # Usually, you won’t know the best solution, and will define this as some value that needs to be maximized. def fitness # Use the ‘genes’ function to retrieve the array of bits representing this solution. -(genes.map(&:to_s).join.to_i(2) - 512).abs end end # Finally, create an instance of a population (with the default size of 20) and let it run for the default number of 100 generations. Population.new(Find512).evolve_on_console

Gemfile:
=

安裝:
=

版本列表:

  1. 0.8.1 February 11, 2009* (218.5 KB)
  2. 0.8.0 February 11, 2008* (203.5 KB)
  3. 0.7.1 January 11, 2008* (198.5 KB)
  4. 0.7.0 January 10, 2008* (199.0 KB)
  5. 0.6.0 December 25, 2007* (85.5 KB)
  6. 0.5.0 December 18, 2007* (78.0 KB)
顯示所有版本(共 6)

Runtime 相依性套件 (1):

hoe >= 1.3.0

擁有者:

作者:

  • Sander Land

SHA 256 總和檢查碼:

=

總下載次數 27,780

這個版本 4,402

版本发布:

授權:

Ruby 版本需求: > 0.0.0

相關連結: