Logo ROOT   6.10/09
Reference Guide
GeneticGenes.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Peter Speckmayer
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : GeneticGenes *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Genes definition for genetic algorithm *
12  * *
13  * Authors (alphabetical): *
14  * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland *
15  * *
16  * Copyright (c) 2005: *
17  * CERN, Switzerland *
18  * MPI-K Heidelberg, Germany *
19  * *
20  * Redistribution and use in source and binary forms, with or without *
21  * modification, are permitted according to the terms listed in LICENSE *
22  * (http://tmva.sourceforge.net/LICENSE) *
23  **********************************************************************************/
24 
25 #ifndef ROOT_TMVA_GeneticGenes
26 #define ROOT_TMVA_GeneticGenes
27 
28 //////////////////////////////////////////////////////////////////////////
29 // //
30 // GeneticGenes //
31 // //
32 // Genes definition for genetic algorithm //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 #include "Rtypes.h"
37 #include <vector>
38 
39 namespace TMVA {
40 
41  class GeneticGenes {
42 
43  public:
44 
46  GeneticGenes( std::vector<Double_t> & f );
47  virtual ~GeneticGenes() {}
48 
49  std::vector<Double_t>& GetFactors() { return fFactors; }
50 
51  void SetFitness(Double_t fitness) { fFitness = fitness; }
52  Double_t GetFitness() const { return fFitness; }
53 
54  friend Bool_t operator <(const GeneticGenes&, const GeneticGenes&);
55 
56  private:
57 
58  std::vector<Double_t> fFactors; // stores the factors (coefficients) of one individual
60 
61  ClassDef(GeneticGenes,0); // Genes definition for genetic algorithm
62  };
63 
65 
66 } // namespace TMVA
67 
68 #endif
bool Bool_t
Definition: RtypesCore.h:59
std::vector< Double_t > fFactors
Definition: GeneticGenes.h:58
#define ClassDef(name, id)
Definition: Rtypes.h:297
Cut optimisation interface class for genetic algorithm.
Definition: GeneticGenes.h:41
void SetFitness(Double_t fitness)
Definition: GeneticGenes.h:51
Double_t GetFitness() const
Definition: GeneticGenes.h:52
double f(double x)
double Double_t
Definition: RtypesCore.h:55
std::vector< Double_t > & GetFactors()
Definition: GeneticGenes.h:49
friend Bool_t operator<(const GeneticGenes &, const GeneticGenes &)
Abstract ClassifierFactory template that handles arbitrary types.
virtual ~GeneticGenes()
Definition: GeneticGenes.h:47