English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Optimizer: TVizir.h Source File
Uranie / Optimizer  v4.10.0
/* @license-end */
TVizir.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
6 // by 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$
22 // $State$
24 
40 #ifndef ROOT_TVIZIR
41 #define ROOT_TVIZIR
42 
43 // Writes log
44 #include <iostream>
45 
47 #include "Rtypes.h"
48 #include "TNamed.h"
49 #include "TMethodCall.h"
50 #include "TMatrixD.h"
51 
52 // Uranie
53 #include "Optimizer.h"
54 #include "TDataServer.h"
55 #include "UExceptions.h"
56 #include "TLauncherEnv.h"
57 #include "TCode.h"
58 
59 // Vizir
61 #define MAXNBGENERATIONS 5
62 #include "vizir.h"
63 
64 
65 
66 namespace URANIE
67 {
68 namespace Optimizer
69 {
70 
71 class TVizir: public URANIE::Launcher::TLauncherEnv
72 {
73 public:
76  Int_t population, duree;
77  TMethodCall *fDecode, *fSoft, *fHard;
78  TMatrixD minmax;
79  URANIE::Launcher::forkcode *_fjob;
80 
81  URANIE::DataServer::TDataServer *_tds;
82  vzr_t *vizir;
83 
84 
85 protected:
86  void rearangeInput(TList *, TString &);
87  void createTuple(TString &);
88 private:
89 
90 public:
91  TString _sdraw;
92  TString _sopt;
93  TString _scut;
95 
96  TVizir(URANIE::DataServer::TDataServer *tds, int npop);
97  virtual ~TVizir();
98  // parametrage
99 
100  //---------------------------------------------
104 
107  void setPrecision(double prec)
108  {
109  precision = prec;
110  }
112  void setSurvivalRate(double val)
113  {
114  survie = val;
115  }
117  void setHomozygoteRate(double val)
118  {
119  zygotie = val;
120  }
122  void setMutationRate(double val)
123  {
124  mutation = val;
125  }
127  void setMaxEvaluation(int val)
128  {
129  duree = val;
130  }
132  void setDecode(const char *, Int_t phys = 0);
133  void setCost(const char *, const char*, int hiden = 0, const char *input = "*");
134  void setConstraintAndCost(const char *, const char*, int, int hiden = 0,
135  const char *input = "*", Bool_t bAddTheAttributes = kTRUE);
136  void setCost(URANIE::Launcher::TCode *, int hiden = 0);
137  void setConstraintAndCost(URANIE::Launcher::TCode *, int, int hiden = 0);
138  void setHardConstraint(const char *);
141  {
142  return vizir1_vzr_generationCount(vizir);
143  }
145 
148  {
149  return _nNbGenerationToDraw;
150  }
152 
154  void setNbGenerationToDraw(Int_t n);
156 
163  void setVarDraw(const char* varexp, const char* selection = "",
164  Option_t* option = "");
166 
167  //---------------------------------------------
171  TMethodCall *copyDecode()
172  {
173  return (fDecode) ? new TMethodCall(*fDecode) : NULL;
174  }
175  TMethodCall *copyCost()
176  {
177  return (fSoft) ? new TMethodCall(*fSoft) : NULL;
178  }
179  TMethodCall *copyHardConstraint()
180  {
181  return (fHard) ? new TMethodCall(*fHard) : NULL;
182  }
183  URANIE::Launcher::TCode *copyCode();
185 
186  //---------------------------------------------
190  void decode(Double_t*, Double_t*, TMethodCall *);
191  int evaluer(Double_t*, Double_t*, TMethodCall*, TMethodCall*, TMethodCall*);
192  int evaluer(Double_t*, Double_t*, TMethodCall*, TMethodCall*,
193  URANIE::Launcher::TCode*);
194  void fitnessChanged();
195  void optimize(Option_t *option = "");
196  void Results();
198 
199  //---------------------------------------------
203  virtual void printLog(Option_t *option = "");
205 
206  ClassDef(URANIE::Optimizer::TVizir, ID_OPTIMIZER)
207  //Classe de
208 };
209 
210 } // Fin du namespace Optimizer
211 } // Fin du namespace URANIE
212 
213 #endif
Rosenbrock&#39;s function (n=2) with first and second order derivatives.
Definition: TBestEstimate.h:57
TMethodCall * fSoft
Definition: TVizir.h:77
void setHomozygoteRate(double val)
Set the proba of homozigotie.
Definition: TVizir.h:117
Double_t mutation
Definition: TVizir.h:74
TMatrixD minmax
Definition: TVizir.h:78
Int_t getNbGenerationToDraw()
Get the number of generation to draw.
Definition: TVizir.h:147
Definition: TVizir.h:71
virtual void printLog(Option_t *option="")
Double_t precision
Definition: TVizir.h:74
Int_t param
Definition: TVizir.h:75
void setDecode(const char *, Int_t phys=0)
Set evaluation.
Int_t intern
Definition: TVizir.h:75
URANIE::DataServer::TDataServer * _tds
Definition: TVizir.h:81
void setMutationRate(double val)
Set the probability of mutation.
Definition: TVizir.h:122
Int_t cost
Definition: TVizir.h:75
void setSurvivalRate(double val)
Set the survival rate.
Definition: TVizir.h:112
void rearangeInput(TList *, TString &)
zjdsjj
Int_t _nNbGenerationToDraw
The number of last generation to draw (Default=2)
Definition: TVizir.h:94
Int_t contrainte
Definition: TVizir.h:75
Int_t population
Definition: TVizir.h:76
TMethodCall * copyDecode()
Definition: TVizir.h:171
vzr_t * vizir
Pointer vers un TDS.
Definition: TVizir.h:82
void setHardConstraint(const char *)
void optimize(Option_t *option="")
void setVarDraw(const char *varexp, const char *selection="", Option_t *option="")
Activates and defines the graphics during the optimization process.
Int_t getLastGenerationIndex()
Get the last generation index.
Definition: TVizir.h:140
int evaluer(Double_t *, Double_t *, TMethodCall *, TMethodCall *, TMethodCall *)
void decode(Double_t *, Double_t *, TMethodCall *)
TString _sdraw
Variables to visualize.
Definition: TVizir.h:91
URANIE::Launcher::forkcode * _fjob
Definition: TVizir.h:79
URANIE::Launcher::TCode * copyCode()
void setConstraintAndCost(const char *, const char *, int, int hiden=0, const char *input="*", Bool_t bAddTheAttributes=kTRUE)
TMethodCall * fDecode
Definition: TVizir.h:77
TVizir(URANIE::DataServer::TDataServer *tds, int npop)
TString _scut
Selection of visualisation.
Definition: TVizir.h:93
void setCost(const char *, const char *, int hiden=0, const char *input="*")
Double_t zygotie
Definition: TVizir.h:74
void setNbGenerationToDraw(Int_t n)
Set the number of generation to draw.
void createTuple(TString &)
TMethodCall * copyCost()
Definition: TVizir.h:175
TMethodCall * copyHardConstraint()
Definition: TVizir.h:179
TString _sopt
Option of visualisation.
Definition: TVizir.h:92
void setPrecision(double prec)
Set the precision.
Definition: TVizir.h:107
Int_t duree
Definition: TVizir.h:76
Int_t hide
Definition: TVizir.h:75
TMethodCall * fHard
Definition: TVizir.h:77
void setMaxEvaluation(int val)
Set the maximum number of evaluation.
Definition: TVizir.h:127
Double_t survie
Definition: TVizir.h:74