English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReOptimizer: TVizirGenetic.h Source File
Uranie / ReOptimizer  v4.10.0
/* @license-end */
TVizirGenetic.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2024 CEA/DES
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or any
7 // later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // $Id$
19 // $Author$
20 // $Date$
21 // $Revision 1.2 $
22 // $State$
24 
32 #ifndef __TVIZIR__
33 #define __TVIZIR__
34 
35 //ROOT
36 #include "Rtypes.h"
37 #include "TNamed.h"
38 
39 // Uranie
40 #include "Reoptimizer.h"
41 #include "TVizirSolver.h"
42 
43 //struct vizir;
44 struct vzrcrossoverbuild;
45 
46 namespace URANIE
47 {
48 namespace Reoptimizer
49 {
50 
52 {
53 public:
54  virtual ~TVizirCrossover()
55  {
56  }
57  virtual struct vzrcrossoverbuild *crossover() = 0;
58 
59  ClassDef(URANIE::Reoptimizer::TVizirCrossover, ID_REOPTIMIZER)
60 };
61 
63 {
64 protected:
65  //struct vizir *_viz;
68  Bool_t _blog, _coded;
69 
70 public:
71  TVizirGenetic();
72  virtual ~TVizirGenetic();
73 
74  // set specific parameter
76  void setSurvivalRate(double val)
77  {
78  _survie = val;
79  }
81  void setHomozygoteRate(double val)
82  {
83  _zygotie = val;
84  }
86  void setMutationRate(double val)
87  {
88  _mutation = val;
89  }
91  void setCrossover(TVizirCrossover *val, Bool_t coded=kFALSE);
92 
93  // protocole
94  virtual struct vzragent *build(int, int, int, double);
95  virtual Bool_t isCoded() {return _coded;}
96 
97  void fitnessChanged(struct vzragent *);
98 
99  //---------------------------------------------
103  void setLog()
104  {
105  _blog = kTRUE;
106  }
107  void unsetLog()
108  {
109  _blog = kFALSE;
110  }
111  void changeLog()
112  {
113  _blog = _blog ? kFALSE : kTRUE;
114  }
115  Bool_t getLog()
116  {
117  return _blog;
118  }
120  virtual void printLog(Option_t *option = "");
123 
124  ClassDef(URANIE::Reoptimizer::TVizirGenetic, ID_REOPTIMIZER)
125 };
126 
127 }
128 } //namespace
129 #endif
Definition: TCMAES.h:66
virtual struct vzragent * build(int, int, int, double)
Definition: TVizirGenetic.cxx:74
void setCrossover(TVizirCrossover *val, Bool_t coded=kFALSE)
Set crossover.
Definition: TVizirGenetic.cxx:99
Bool_t getLog()
Definition: TVizirGenetic.h:115
Bool_t _blog
Definition: TVizirGenetic.h:68
Definition: TVizirGenetic.h:51
void setMutationRate(double val)
Set the probability of mutation.
Definition: TVizirGenetic.h:86
virtual Bool_t isCoded()
Definition: TVizirGenetic.h:95
virtual struct vzrcrossoverbuild * crossover()=0
void unsetLog()
Definition: TVizirGenetic.h:107
virtual ~TVizirCrossover()
Definition: TVizirGenetic.h:54
void setHomozygoteRate(double val)
Set the proba of homozigotie.
Definition: TVizirGenetic.h:81
classe abstraite et racine pour les solvers de Vizir
void fitnessChanged(struct vzragent *)
Definition: TVizirGenetic.cxx:106
void setLog()
Definition: TVizirGenetic.h:103
double _mutation
Definition: TVizirGenetic.h:67
double _survie
Definition: TVizirGenetic.h:67
void changeLog()
Definition: TVizirGenetic.h:111
virtual void printLog(Option_t *option="")
print log
Definition: TVizirGenetic.cxx:112
TVizirCrossover * _cross
Definition: TVizirGenetic.h:66
Bool_t _coded
Definition: TVizirGenetic.h:68
Definition: TVizirGenetic.h:62
virtual ~TVizirGenetic()
Definition: TVizirGenetic.cxx:69
Definition: TVizirSolver.h:77
double _zygotie
Definition: TVizirGenetic.h:67
void setSurvivalRate(double val)
Set the survival rate.
Definition: TVizirGenetic.h:76
TVizirGenetic()
Definition: TVizirGenetic.cxx:60