ROOT  6.06/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 #ifndef ROOT_Rtypes
37 #include "Rtypes.h"
38 #endif
39 #include <vector>
40 
41 namespace TMVA {
42 
43  class GeneticGenes {
44 
45  public:
46 
48  GeneticGenes( std::vector<Double_t> & f );
49  virtual ~GeneticGenes() {}
50 
51  std::vector<Double_t>& GetFactors() { return fFactors; }
52 
53  void SetFitness(Double_t fitness) { fFitness = fitness; }
54  Double_t GetFitness() const { return fFitness; }
55 
56  friend Bool_t operator <(const GeneticGenes&, const GeneticGenes&);
57 
58  private:
59 
60  std::vector<Double_t> fFactors; // stores the factors (coefficients) of one individual
62 
63  ClassDef(GeneticGenes,0) // Genes definition for genetic algorithm
64  };
65 
67 
68 } // namespace TMVA
69 
70 #endif
bool Bool_t
Definition: RtypesCore.h:59
std::vector< Double_t > fFactors
Definition: GeneticGenes.h:60
#define ClassDef(name, id)
Definition: Rtypes.h:254
void SetFitness(Double_t fitness)
Definition: GeneticGenes.h:53
double f(double x)
double Double_t
Definition: RtypesCore.h:55
Double_t GetFitness() const
Definition: GeneticGenes.h:54
std::vector< Double_t > & GetFactors()
Definition: GeneticGenes.h:51
Bool_t operator<(const GeneticGenes &, const GeneticGenes &)
friend Bool_t operator<(const GeneticGenes &, const GeneticGenes &)
Abstract ClassifierFactory template that handles arbitrary types.
virtual ~GeneticGenes()
Definition: GeneticGenes.h:49