English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Optimizer: TVizir.h Source File
Uranie / Optimizer v4.9.0
/* @license-end */
TVizir.h
Go to the documentation of this file.
1
2// 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 "TCode.h"
57
58// Vizir
60#define MAXNBGENERATIONS 5
61#include "vizir.h"
62
63
64
65namespace URANIE
66{
67namespace Optimizer
68{
69class TVizir: public TNamed
70{
71public:
75 TMethodCall *fDecode, *fSoft, *fHard;
76 TMatrixD minmax;
77
78 Bool_t _blog;
79 URANIE::DataServer::TDataServer *_tds;
80 URANIE::Launcher::TCode *_code;
81 TString _sdirectory;
82 vzr_t *vizir;
83
84
85protected:
86 void rearangeInput(TList *, TString &);
87 void createTuple(TString &);
88private:
89
90public:
91 TString _sdraw;
92 TString _sopt;
93 TString _scut;
95
96 // TVizir();
97 TVizir(URANIE::DataServer::TDataServer *tds, int npop);
98 virtual ~TVizir();
99 // parametrage
100 // void init(URANIE::DataServer::TDataServer *tds, int npop);
101
102 //---------------------------------------------
106
109 void setPrecision(double prec)
110 {
111 precision = prec;
112 }
114 void setSurvivalRate(double val)
115 {
116 survie = val;
117 }
119 void setHomozygoteRate(double val)
120 {
121 zygotie = val;
122 }
124 void setMutationRate(double val)
125 {
126 mutation = val;
127 }
129 void setMaxEvaluation(int val)
130 {
131 duree = val;
132 }
134 void setDecode(const char *, Int_t phys = 0);
135 void setCost(const char *, const char*, int hiden = 0, const char *input = "*");
136 void setConstraintAndCost(const char *, const char*, int, int hiden = 0,
137 const char *input = "*", Bool_t bAddTheAttributes = kTRUE);
138 void setCost(URANIE::Launcher::TCode *, int hiden = 0);
139 void setConstraintAndCost(URANIE::Launcher::TCode *, int, int hiden = 0);
140 void setHardConstraint(const char *);
143 {
144 return vizir1_vzr_generationCount(vizir);
145 }
147
150 {
152 }
154
158
165 void setVarDraw(const char* varexp, const char* selection = "",
166 Option_t* option = "");
167 // TString str, TString select ="", TString opt="");
169
170 //---------------------------------------------
174 TMethodCall *copyDecode()
175 {
176 return (fDecode) ? new TMethodCall(*fDecode) : NULL;
177 }
178 TMethodCall *copyCost()
179 {
180 return (fSoft) ? new TMethodCall(*fSoft) : NULL;
181 }
182 TMethodCall *copyHardConstraint()
183 {
184 return (fHard) ? new TMethodCall(*fHard) : NULL;
185 }
186 URANIE::Launcher::TCode *copyCode();
188
189 //---------------------------------------------
193 void decode(Double_t*, Double_t*, TMethodCall *);
194 int evaluer(Double_t*, Double_t*, TMethodCall*, TMethodCall*, TMethodCall*);
195 int evaluer(Double_t*, Double_t*, TMethodCall*, TMethodCall*,
196 URANIE::Launcher::TCode*);
198 void optimize(Option_t *option = "");
199 void Results();
201
202 //---------------------------------------------
206 void setLog()
207 {
208 _blog = kTRUE;
209 }
210 void unsetLog()
211 {
212 _blog = kFALSE;
213 }
215 {
216 _blog = _blog ? kFALSE : kTRUE;
217 }
218 Bool_t getLog()
219 {
220 return _blog;
221 }
222 virtual void printLog(Option_t *option = "");
224
225 ClassDef(URANIE::Optimizer::TVizir, ID_OPTIMIZER)
226 //Classe de
227};
228
229} // Fin du namespace Optimizer
230} // Fin du namespace URANIE
231
232#endif
Definition TVizir.h:70
void setVarDraw(const char *varexp, const char *selection="", Option_t *option="")
Activates and defines the graphics during the optimization process.
virtual void printLog(Option_t *option="")
TMethodCall * copyCost()
Definition TVizir.h:178
Bool_t _blog
Boolean to edit the log.
Definition TVizir.h:78
Int_t getNbGenerationToDraw()
Get the number of generation to draw.
Definition TVizir.h:149
void setCost(const char *, const char *, int hiden=0, const char *input="*")
Int_t cost
Definition TVizir.h:73
void decode(Double_t *, Double_t *, TMethodCall *)
TString _sopt
Option of visualisation.
Definition TVizir.h:92
TMethodCall * copyDecode()
Definition TVizir.h:174
Int_t param
Definition TVizir.h:73
TVizir(URANIE::DataServer::TDataServer *tds, int npop)
void setDecode(const char *, Int_t phys=0)
Set evaluation.
void setMutationRate(double val)
Set the probability of mutation.
Definition TVizir.h:124
void setLog()
Definition TVizir.h:206
TString _sdraw
Variables to visualize.
Definition TVizir.h:91
void setCost(URANIE::Launcher::TCode *, int hiden=0)
int evaluer(Double_t *, Double_t *, TMethodCall *, TMethodCall *, URANIE::Launcher::TCode *)
void setNbGenerationToDraw(Int_t n)
Set the number of generation to draw.
void setConstraintAndCost(const char *, const char *, int, int hiden=0, const char *input="*", Bool_t bAddTheAttributes=kTRUE)
void rearangeInput(TList *, TString &)
zjdsjj
void optimize(Option_t *option="")
void unsetLog()
Definition TVizir.h:210
URANIE::Launcher::TCode * _code
Pointer vers un TDS.
Definition TVizir.h:80
TMethodCall * fDecode
Definition TVizir.h:75
Bool_t getLog()
Definition TVizir.h:218
Double_t zygotie
Definition TVizir.h:72
vzr_t * vizir
Definition TVizir.h:82
void setPrecision(double prec)
Set the precision.
Definition TVizir.h:109
Double_t mutation
Definition TVizir.h:72
void changeLog()
Definition TVizir.h:214
TString _sdirectory
Current directory.
Definition TVizir.h:81
URANIE::Launcher::TCode * copyCode()
int evaluer(Double_t *, Double_t *, TMethodCall *, TMethodCall *, TMethodCall *)
Int_t contrainte
Definition TVizir.h:73
Int_t population
Definition TVizir.h:74
void setMaxEvaluation(int val)
Set the maximum number of evaluation.
Definition TVizir.h:129
TMethodCall * fHard
Definition TVizir.h:75
URANIE::DataServer::TDataServer * _tds
Definition TVizir.h:79
Int_t _nNbGenerationToDraw
The number of last generation to draw (Default=2)
Definition TVizir.h:94
Int_t duree
Definition TVizir.h:74
TMatrixD minmax
Definition TVizir.h:76
void setConstraintAndCost(URANIE::Launcher::TCode *, int, int hiden=0)
Int_t intern
Definition TVizir.h:73
TMethodCall * copyHardConstraint()
Definition TVizir.h:182
void setHardConstraint(const char *)
Int_t getLastGenerationIndex()
Get the last generation index.
Definition TVizir.h:142
Int_t hide
Definition TVizir.h:73
void createTuple(TString &)
void setHomozygoteRate(double val)
Set the proba of homozigotie.
Definition TVizir.h:119
Double_t survie
Definition TVizir.h:72
void setSurvivalRate(double val)
Set the survival rate.
Definition TVizir.h:114
Double_t precision
Definition TVizir.h:72
TString _scut
Selection of visualisation.
Definition TVizir.h:93
TMethodCall * fSoft
Definition TVizir.h:75
Rosenbrock's function (n=2) with first and second order derivatives.
Definition TBestEstimate.h:58