# Charlie 0.7.0 Released - A genetic algorithms library

**URL:** <https://www.ruby-forum.com/t/charlie-0-7-0-released-a-genetic-algorithms-library/125726>\
**Category:** Ruby\
**Created:** [January 11, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/charlie-0-7-0-released-a-genetic-algorithms-library/125726 "2008-01-11T15:36:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@sander](https://www.ruby-forum.com/u/sander)\
**Post date:** [January 11, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/charlie-0-7-0-released-a-genetic-algorithms-library/125726/1 "2008-01-11T15:36:30Z")

</div>

Hi all,

I’m pleased to announce another release of charlie, a genetic  
algorithms library for Ruby.

This release extends the options for TreeGenotype, making the library  
more useful for genetic programming.  
It also includes full Ruby 1.9 compatibility, as well of a variety of  
smaller changes.

There has been no feedback at all on the previous releases. If you  
find anything is not working, important features are missing, or have  
any other comments, please let me know.

## FEATURES:

- Quickly develop GAs by combining several parts (genotype, selection,  
crossover, mutation) provided by the library.
- Sensible defaults are provided with any genotype, so often you only  
need to define a fitness function.
- Easily replace any of the parts by your own code.
- Test different strategies in GA, and generate reports comparing them.

## EXAMPLE

This example finds a polynomial which approximates cos(x)

class Cos \< TreeGenotype([proc{rand},:x], [:-@], [:+,:\*,:-])  
def fitness  
-[0,0.33,0.66,1].map{|x| (eval\_genes(:x=\>x) - Math.cos(x)).abs }.max  
end  
use TournamentSelection(4)  
end  
Population.new(Cos).evolve\_on\_console(500)

Several other examples are included in the gem/tarball.

## INSTALLATION:

- sudo gem install charlie

## Links

- [http://rubyforge.org/projects/charlie/](http://rubyforge.org/projects/charlie/)
- [http://charlie.rubyforge.org](http://charlie.rubyforge.org)

## LICENSE:

MIT license.

---

<div class="post-metadata">

**Author:** ![sander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@sander](https://www.ruby-forum.com/u/sander)\
**Post date:** [January 12, 2008, 3:42pm UTC](https://www.ruby-forum.com/t/charlie-0-7-0-released-a-genetic-algorithms-library/125726/2 "2008-01-12T15:42:47Z")

</div>

Version 0.7.1 was just released. It fixes a bug with RouletteSelection  
and ScaledRouletteSelection.  
This bug was present in all previous versions, and significantly  
decreased the convergence speed of these selection algorithms.
