Maintainer
I M Ikram
Description
Some simple » genetic algorithm (GA) classes, aimed at solving optimization problems (both minimization and maximization).
Categories
Versions
Links
Details
Files
- ran.e
- interface to 'C' standard random number generation functions. The necessary external code is included in the file.
- individual.e
- individual_copyable.e: deferred classes relating to bit-string individuals
- population.e, ss_population.e, gen_population.e
- deferred classes relating to populations of bit strings
- one_max.e, two_max.e, many_max.e, dejong_f1.e
- some actual implementations of individuals corresponding to simple fitness functions
- ss_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 problems
- ga_demo.e
- allows any combination of the above fitness functions and genetic algorithms to be run
Class Hierarchy
RAN
-- random numbers |
INDIVIDUAL
-- bit-string individuals
INDIVIDUAL_COPYABLE
--
reproducible individuals
ONE_MAX, TWO_MAX, MANY_MAX, DEJONG_F1
-- individuals meant to encode solutions to some
simple optimization problems |
POPULATION
-- 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 strategies |
GA_DEMO
-- demo/testing |
Notes
- To define a new optimization problem, write a subclass of INDIVIDUAL_COPYABLE with a routine called evaluate, which should set the value of the individual to some problem-dependent function of the individual's bit-string. See example classes at the bottom of the INDIVIDUAL hierarchy.
- To define a new genetic algorithm, subclass either SS_POPULATION or GEN_POPULATION, depending on whether it is to be a steady-state or a generational algorithm. The new class should have an evolve routine that implements one evolutionary step or generation. This routine should select parents from the current population for mating, and then evaluate the resulting children and place them (if needed) in the population. See example classes at the bottom of the POPULATION hierarchy.
- New subclasses may be tested by adding relevant clauses to the inspect instructions in GA_DEMO's make_population routine.
Supported compilers
Licensing