[ Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]
Genetic Algorithm classesWritten by I. M. Ikram
ga.tar.gz (9803 bytes)
Some simple genetic algorithm (GA) classes in Eiffel, aimed at solving optimization problems (both minimization and maximization). For a very quick and easy introduction to genetic algorithms, see http://www.cs.und.ac.za/~ikram/Projects/gaintro.html
I. M. IkramYou may modify and redistribute this code non-commercially. Please contact me if you wish to offer any comments, error reports, corrections, new classes, etc. Any updates made in future to these classes may be accessed through the URL: http://cs.und.ac.za/~ikram/Projects/GAEiffel/
These classes were developed with the aid of the excellent SmallEiffel freeware compiler, version -0.98, made available by Dominique Colnet and Suzanne Collin (ftp://ftp.loria.fr/pub/loria/genielog/SmallEiffel). Significant omissions from this version of the compiler are the BIT type, a standard random number class, and most of all, garbage collection (so I've been careful to avoid `memory leaks' here).
ran.e interface to `C' standard random number generation functions.
Necessary external code is included in the file.individual.e individual_copyable.e: deferred classes relating to
bit-string individualspopulation.e, ss_population.e, gen_population.e deferred classes
relating to populations of bit stringsone_max.e, two_max.e, many_max.e, dejong_f1.e some actual
implementations of individuals corresponding to simple fitness
functionsss_pop_1.e, ss_pop_2.e, ss_pop_3.e, gen_pop_1.e some actual
implementations of populations capable of running simple genetic
algorithms to solve optimization problemsga_demo.e allows any combination of the above fitness functions
and genetic algorithms to be run
RAN
-- random numbersINDIVIDUAL
-- bit-string individuals
INDIVIDUAL_COPYABLE
-- reproducible individuals
ONE_MAX, TWO_MAX, MANY_MAX, DEJONG_F1
-- individuals meant to encode solutions to some simple optimization problemsPOPULATION
-- populations of bit-string individuals
SS_POPULATION
-- populations running steady-state algorithms
SS_POP_1, SS_POP_2, SS_POP_3
-- various steady-state strategies
GEN_POPULATION
-- populations running generational algorithms
GEN_POP_1
-- simple generational strategiesGA_DEMO
-- demo/testing
See implementation of GA_DEMO class and header comments to the remaining classes.
[ Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]