MTK++ Latest version: 0.2.0

gaAverage.h
Go to the documentation of this file.
00001 
00033 #ifndef GAAVERAGE_H
00034 #define GAAVERAGE_H
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 
00040 namespace MTKpp
00041 {
00042 
00043 class gaOperators;
00044 class gaIndividual;
00045 class gaPopulation;
00046 
00047 // ============================================================
00048 // Class : gaAverage()
00049 // ------------------------------------------------------------
00057 // ============================================================
00058 
00059 class gaAverage
00060 {
00061 public:
00062 
00071     gaAverage(gaOperators *parent,std::vector<int> genePerChr, int nChild = 1, 
00072               std::string aver = "single-gene", int chrPerInd = 1);
00073 
00075     virtual ~gaAverage();
00076 
00085     bool average(gaIndividual* ind1, gaIndividual* ind2, gaPopulation* pop, std::string name);
00086 
00087 protected:
00088 
00094     bool __singleGene(gaIndividual* newInd, gaIndividual* parent);
00095 
00101     bool __multipleGene(gaIndividual* newInd, gaIndividual* parent);
00102 
00103 private:
00104 
00106     gaOperators*                  pParent;
00107 
00109     int                           nChild;
00110 
00112     std::string                   aver;
00113 
00115     int                           chrPerInd;
00116 
00118     std::vector<int>              genePerChr;
00119 };
00120 
00121 } // MTKpp namespace
00122 
00123 #endif // GAAVERAGE_H

Generated on Fri Dec 23 2011 09:28:50 for MTK++ by Doxygen 1.7.5.1