English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReOptimizer: TOptimShare.h Source File
Uranie / ReOptimizer  v4.11.0
/* @license-end */
TOptimShare.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.4 $
22 // $State$
24 
32 #ifndef __TOPTIMSHARE__
33 #define __TOPTIMSHARE__
34 
35 //ROOT
36 #include "Rtypes.h"
37 #include "TNamed.h"
38 
39 // Uranie
40 #include "Reoptimizer.h"
41 #include "TMaster.h"
42 
43 #include "TDataServer.h"
44 #include "TEval.h"
45 #include "TOptimFit.h"
46 
47 namespace URANIE
48 {
49 namespace Reoptimizer
50 {
51 
52 class TOptimShare: public URANIE::Relauncher::TMaster
53 {
54 private:
55  void create();
56 
57 protected:
58  //int _gene, _hide;
59  double _prec;
60  TObjArray _const;
61  URANIE::DataServer::TDataServer *_tdstrc;
62  int _idtrc;
63  Bool_t _blog;
64 
65  void initTrace();
66 
67 public:
68  TOptimShare(URANIE::DataServer::TDataServer *tds,
69  URANIE::Relauncher::TRun *run);
70  TOptimShare(URANIE::DataServer::TDataServer *tds,
71  URANIE::Relauncher::TEval *fun);
72  virtual ~TOptimShare();
73 
74  // initialisation
75  virtual void addObjective(URANIE::DataServer::TAttribute *, TOptimFit *f =
76  NULL) = 0;
77  void addConstraint(URANIE::DataServer::TAttribute *, TOptimFit *f = NULL);
79  void setTolerance(double prec)
80  {
81  _prec = prec;
82  }
83  double getTolerance()
84  {
85  return _prec;
86  }
87  virtual void setStartingPoint(double *pt);
88  virtual void setStartingPoint(int nb, double *pt);
89  virtual void setMaximumEval(int max) = 0;
90 
91  void setTrace(URANIE::DataServer::TDataServer *tds) { _tdstrc = tds; }
92 
94  //virtual void solverLoop(URANIE::Relauncher::TRun *) = 0;
95  //---------------------------------------------
99  void setLog()
100  {
101  _blog = kTRUE;
102  }
103  void unsetLog()
104  {
105  _blog = kFALSE;
106  }
107  void changeLog()
108  {
109  _blog = _blog ? kFALSE : kTRUE;
110  }
111  Bool_t getLog()
112  {
113  return _blog;
114  }
116 
117  ClassDef(URANIE::Reoptimizer::TOptimShare, ID_REOPTIMIZER)
118 };
119 
120 
121 class TOptimSolver : public TObject
122 {
123 public:
125  virtual ~TOptimSolver() {};
126 
127  virtual TOptimShare *getMaster(URANIE::DataServer::TDataServer *tds,
128  URANIE::Relauncher::TRun *run) = 0;
129 
130  ClassDef(URANIE::Reoptimizer::TOptimSolver, ID_REOPTIMIZER)
131 };
132 
135 {
136 public:
137  TOptimReprise(URANIE::DataServer::TDataServer *tds,
138  URANIE::Relauncher::TRun *run) : TOptimShare(tds, run) {};
139  TOptimReprise(URANIE::DataServer::TDataServer *tds,
140  URANIE::Relauncher::TEval *fun) : TOptimShare(tds, fun) {};
141  virtual ~TOptimReprise() {};
142 
144  virtual void extend(int more) = 0;
145  virtual int item(int id, double *in, double *out) = 0;
146 
147  ClassDef(URANIE::Reoptimizer::TOptimReprise, ID_REOPTIMIZER)
148 };
149 
151 {
152 public:
154  virtual ~TOptimRepriseSolver() {};
155 
156  virtual TOptimReprise *getMaster(URANIE::DataServer::TDataServer *tds,
157  URANIE::Relauncher::TRun *run) = 0;
158 
159  ClassDef(URANIE::Reoptimizer::TOptimRepriseSolver, ID_REOPTIMIZER)
160 };
161 
162 }
163 } //namespace
164 
165 #endif
Definition: TCMAES.cxx:49
virtual void extend(int more)=0
objectifs et contraintes standards
TObjArray _const
Definition: TOptimShare.h:60
int _idtrc
Definition: TOptimShare.h:62
virtual void setMaximumEval(int max)=0
double _prec
Definition: TOptimShare.h:59
TOptimSolver()
Definition: TOptimShare.h:124
virtual TOptimShare * getMaster(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run)=0
TOptimReprise(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TEval *fun)
Definition: TOptimShare.h:139
void create()
Definition: TOptimShare.cxx:115
Bool_t getLog()
Definition: TOptimShare.h:111
Definition: TOptimShare.h:121
TOptimReprise(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run)
Definition: TOptimShare.h:137
Definition: TOptimShare.h:52
Definition: TOptimFit.h:47
virtual ~TOptimReprise()
Definition: TOptimShare.h:141
virtual ~TOptimShare()
Definition: TOptimShare.cxx:105
TOptimShare(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run)
Definition: TOptimShare.cxx:50
void changeLog()
Definition: TOptimShare.h:107
virtual TOptimReprise * getMaster(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run)=0
Bool_t _blog
Definition: TOptimShare.h:63
void setTrace(URANIE::DataServer::TDataServer *tds)
Definition: TOptimShare.h:91
void addConstraint(URANIE::DataServer::TAttribute *, TOptimFit *f=NULL)
Definition: TOptimShare.cxx:138
URANIE::DataServer::TDataServer * _tdstrc
Definition: TOptimShare.h:61
TOptimRepriseSolver()
Definition: TOptimShare.h:153
void setLog()
Definition: TOptimShare.h:99
Definition: TOptimShare.h:150
virtual ~TOptimRepriseSolver()
Definition: TOptimShare.h:154
Definition: TOptimShare.h:134
void initTrace()
Definition: TOptimShare.cxx:146
virtual ~TOptimSolver()
Definition: TOptimShare.h:125
virtual void setStartingPoint(double *pt)
Definition: TOptimShare.cxx:127
void unsetLog()
Definition: TOptimShare.h:103
virtual int item(int id, double *in, double *out)=0
virtual void addObjective(URANIE::DataServer::TAttribute *, TOptimFit *f=NULL)=0
void setTolerance(double prec)
Set the mono precision stop threshold.
Definition: TOptimShare.h:79
double getTolerance()
Definition: TOptimShare.h:83