00001 // @(#)root/tmva $Id: GeneticGenes.h 31458 2009-11-30 13:58:20Z stelzer $ 00002 // Author: Peter Speckmayer 00003 00004 /********************************************************************************** 00005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00006 * Package: TMVA * 00007 * Class : GeneticGenes * 00008 * Web : http://tmva.sourceforge.net * 00009 * * 00010 * Description: * 00011 * Genes definition for genetic algorithm * 00012 * * 00013 * Authors (alphabetical): * 00014 * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland * 00015 * * 00016 * Copyright (c) 2005: * 00017 * CERN, Switzerland * 00018 * MPI-K Heidelberg, Germany * 00019 * * 00020 * Redistribution and use in source and binary forms, with or without * 00021 * modification, are permitted according to the terms listed in LICENSE * 00022 * (http://tmva.sourceforge.net/LICENSE) * 00023 **********************************************************************************/ 00024 00025 #ifndef ROOT_TMVA_GeneticGenes 00026 #define ROOT_TMVA_GeneticGenes 00027 00028 ////////////////////////////////////////////////////////////////////////// 00029 // // 00030 // GeneticGenes // 00031 // // 00032 // Genes definition for genetic algorithm // 00033 // // 00034 ////////////////////////////////////////////////////////////////////////// 00035 00036 #ifndef ROOT_Rtypes 00037 #include "Rtypes.h" 00038 #endif 00039 #include <vector> 00040 00041 namespace TMVA { 00042 00043 class GeneticGenes { 00044 00045 public: 00046 00047 GeneticGenes():fFitness(0) {} 00048 GeneticGenes( std::vector<Double_t> & f ); 00049 virtual ~GeneticGenes() {} 00050 00051 std::vector<Double_t>& GetFactors() { return fFactors; } 00052 00053 void SetFitness(Double_t fitness) { fFitness = fitness; } 00054 Double_t GetFitness() const { return fFitness; } 00055 00056 friend Bool_t operator <(const GeneticGenes&, const GeneticGenes&); 00057 00058 private: 00059 00060 std::vector<Double_t> fFactors; // stores the factors (coefficients) of one individual 00061 Double_t fFitness; 00062 00063 ClassDef(GeneticGenes,0) // Genes definition for genetic algorithm 00064 }; 00065 00066 Bool_t operator <(const GeneticGenes&, const GeneticGenes&); 00067 00068 } // namespace TMVA 00069 00070 #endif