Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:59

0001 // @(#)root/tmva $Id$
0002 // Author: Peter Speckmayer
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : GeneticGenes                                                          *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Genes definition for genetic algorithm                                    *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Peter Speckmayer <speckmay@mail.cern.ch>  - CERN, Switzerland             *
0015  *                                                                                *
0016  * Copyright (c) 2005:                                                            *
0017  *      CERN, Switzerland                                                         *
0018  *      MPI-K Heidelberg, Germany                                                 *
0019  *                                                                                *
0020  * Redistribution and use in source and binary forms, with or without             *
0021  * modification, are permitted according to the terms listed in LICENSE           *
0022  * (see tmva/doc/LICENSE)                                          *
0023  **********************************************************************************/
0024 
0025 #ifndef ROOT_TMVA_GeneticGenes
0026 #define ROOT_TMVA_GeneticGenes
0027 
0028 //////////////////////////////////////////////////////////////////////////
0029 //                                                                      //
0030 // GeneticGenes                                                         //
0031 //                                                                      //
0032 // Genes definition for genetic algorithm                               //
0033 //                                                                      //
0034 //////////////////////////////////////////////////////////////////////////
0035 
0036 #include "Rtypes.h"
0037 #include <vector>
0038 
0039 namespace TMVA {
0040 
0041    class GeneticGenes {
0042 
0043    public:
0044 
0045    GeneticGenes():fFitness(0) {}
0046       GeneticGenes( std::vector<Double_t> & f );
0047       virtual ~GeneticGenes() {}
0048 
0049       std::vector<Double_t>& GetFactors() { return fFactors; }
0050 
0051       void SetFitness(Double_t fitness) { fFitness = fitness; }
0052       Double_t GetFitness() const { return fFitness; }
0053 
0054       friend Bool_t operator <(const GeneticGenes&, const GeneticGenes&);
0055 
0056    private:
0057 
0058       std::vector<Double_t> fFactors; // stores the factors (coefficients) of one individual
0059       Double_t fFitness;
0060 
0061       ClassDef(GeneticGenes,0); // Genes definition for genetic algorithm
0062    };
0063 
0064    Bool_t operator <(const GeneticGenes&, const GeneticGenes&);
0065 
0066 } // namespace TMVA
0067 
0068 #endif