Grammatical Evolution Ruby Exploratory Toolkit (GERET)
Copyright © 2009 Pavel Suchmann, please see the LICENSE file.
GERET is the toolkit & library designed to explore the potential of the Grammatical Evolution.
Grammatical Evolution is a system which can be used to automatically generate programs or solutions in any language.
Please see the inventors’ pages:
or read the general introduction:
or purchase the book written by GE creators:
Features
- multiple objectives optimisation
- human-readable yaml-based configuration
- ABNF conformance
- various GE mappers (bucket rule, positional independence, several node expansion strategies, wrapping…)
- attribute grammars support (mapping with semantics of context-free grammars)
- various genetic operators (ripple & LHS crossover, nodal/structural mutations)
- various search algorithms (SPEA2, NSGA2, ALPS… easily extensible by new ones)
- simple & efficient interface to the domain-specific task
See the library documentation.
Requirements
The library itself is written in pure Ruby, no gem dependencies needed.
Ruby versions tested: 1.8.7-p334, 1.9.2-p180, 1.9.2-p290, 1.9.3-preview1
Samples require various software (tcc compiler, Java VM, GHDL simulator). Please read a particular sample/*/README.
Installation
There are no special installation steps at this moment. Please clone the git repo:
git clone git://github.com/bver/GERET.git cd GERET ruby test/ts_all.rb # check the library ruby test/integration.rb # check tools & sample runs -- (a long run)
(To be changed in the future.)
Play Now
Run:
ruby tools/evolve.rb sample/task/algorithm.yaml
for evolution of a task sample using a search algorithm.
ls sample/ # shows all existing sample tasks. ls sample/task/*.yaml # lists all algorithms available for the specific _task_. ls sample/*/*.yaml # gives all possible task/algorithm combinations.
Interrupt the run by ^C. Repeated evolve.rb invocation loads algorithm.store and continues evolving.
Remove algorithm.store if you want to start population(s) from scratch.
(Note – repeated invocation may not work for WorkPipes evaluator, see configuration).
Tune algorithm.yaml files to see some experiments failing. :-)
For example:
ruby tools/evolve.rb sample/santa_fe_ant_trail/generational.yaml
Other implementations of GE
More Advanced Games
Try various tools/*
For instance:
# generate the genotype: ruby tools/sensible_init.rb sample/santa_fe_ant_trail/generational.yaml > genotype.txt # see the genotype: cat genotype.txt # see the phenotype: ruby tools/gpmap.rb sample/santa_fe_ant_trail/generational.yaml < genotype.txt
See algorithm/* for various search algorithms.
Look at lib/* for reusable classes.
Generate the class documentation:
cd lib/ rdoc your-favourite-browser doc/index.html &
Hack your own grammar.abnf files.
Try to write your own pipe.rb tasks (or pipe.py, pipe.java, /usr/local/bin/pipe… )
…
No Guarantees
GERET is the exploratory software.
The functionality of the package nor the stability of interfaces is not guaranteed at this stage of development.
If you have an interesting idea for GERET usage give me know: bver at geret.org
News
2019-12-28:
Ruby 2.4 version supported.
2012-05-16:
Algebraic simplification implemented.
2011-09-16:
Embedded constants implemented.
2011-09-08:
Fixed paths to the Ruby interpreter removed, supporting Ruby 1.9.3
2011-01-01:
Age Hierarchy Tree algorithm implemented.
2010-07-25:
Bugfixes, mappers simplified, a new codon representation level interface, Gray transcription, etc.
2010-06-19:
Sensible initialisation respects the minimal depth of the node (supporting "deep" grammars).
2010-03-28:
Initial ALPS experiments look promising.
2010-02-23:
Now supporting attribute grammars.
2010-01-09:
GERET was listed on grammatical-evolution.org site.