00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "gaconfig.h"
00021 #include "crossovers/onepoint.h"
00022 #include "evaluations/multitrials.h"
00023 #include "gas/laralga.h"
00024 #include "gas/simplega.h"
00025 #include "gas/parallelga.h"
00026 #include "gas/nsga2.h"
00027 #include "gas/stefanosteadystatega.h"
00028 #include "core/genome.h"
00029 #include "genotypes/realgenotype.h"
00030 #include "genotypes/signedrangegenotype.h"
00031 #include "mutations/flipbit.h"
00032 #include "mutations/randombit.h"
00033 #include "mutations/randomfloat.h"
00034 #include "mutations/gaussianfloat.h"
00035 #include "reproductions/fixedsize.h"
00036 #include "selections/deterministicrank.h"
00037 #include "selections/roulettewheelselection.h"
00038
00039
00040 #include "configurationparameters.h"
00041 #include "parametersettable.h"
00042 #include "factory.h"
00043 #include "logger.h"
00044
00045 namespace farsa {
00046
00047 bool initGALib() {
00048 static bool dummy = false;
00049 if ( dummy ) return true;
00050
00051 Factory::getInstance().registerClass<Crossover>( "Crossover", "ParameterSettableWithConfigureFunction" );
00052 Factory::getInstance().registerClass<OnePoint>( "OnePoint", "Crossover" );
00053
00054 Factory::getInstance().registerClass<Evaluation>( "Evaluation", "ParameterSettableWithConfigureFunction" );
00055 Factory::getInstance().registerClass<MultiTrials>( "MultiTrials", "Evaluation" );
00056
00057 Factory::getInstance().registerClass<GeneticAlgo>( "GeneticAlgo", "ParameterSettableWithConfigureFunction" );
00058 Factory::getInstance().registerClass<LaralGA>( "LaralGA", "GeneticAlgo" );
00059 Factory::getInstance().registerClass<SimpleGA>( "SimpleGA", "GeneticAlgo" );
00060 Factory::getInstance().registerClass<ParallelGA>( "ParallelGA", "GeneticAlgo" );
00061 Factory::getInstance().registerClass<NSGA2>( "NSGA2", "GeneticAlgo" );
00062 Factory::getInstance().registerClass<StefanoSteadyStateGA>( "StefanoSteadyStateGA", "GeneticAlgo" );
00063
00064 Factory::getInstance().registerClass<Genotype>( "Genotype", "ParameterSettableWithConfigureFunction" );
00065 Factory::getInstance().registerClass<DoubleGenotype>( "DoubleGenotype", "Genotype" );
00066 Factory::getInstance().registerClass<RealGenotype>( "RealGenotype", "DoubleGenotype" );
00067 Factory::getInstance().registerClass<SignedRangeGenotype>( "SignedRangeGenotype", "DoubleGenotype" );
00068
00069 Factory::getInstance().registerClass<Genome>( "Genome", "ParameterSettableWithConfigureFunction" );
00070
00071 Factory::getInstance().registerClass<Mutation>( "Mutation", "ParameterSettableWithConfigureFunction" );
00072 Factory::getInstance().registerClass<FlipBit>( "FlipBit", "Mutation" );
00073 Factory::getInstance().registerClass<RandomBit>( "RandomBit", "Mutation" );
00074 Factory::getInstance().registerClass<RandomFloat>( "RandomFloat", "Mutation" );
00075 Factory::getInstance().registerClass<GaussianFloat>( "GaussianFloat", "Mutation" );
00076
00077 Factory::getInstance().registerClass<Reproduction>( "Reproduction", "ParameterSettableWithConfigureFunction" );
00078 Factory::getInstance().registerClass<FixedSize>( "FixedSize", "Reproduction" );
00079
00080 Factory::getInstance().registerClass<Selection>( "Selection", "ParameterSettableWithConfigureFunction" );
00081 Factory::getInstance().registerClass<DeterministicRank>( "DeterministicRank", "Selection" );
00082 Factory::getInstance().registerClass<RouletteWheelSelection>( "RouletteWheelSelection", "Selection" );
00083
00084 dummy = true;
00085 Logger::info( "Library GA initialized" );
00086 return true;
00087 }
00088
00089 }