English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / MetaModelOptim: TEGO.h Source File
Uranie / MetaModelOptim v4.9.0
/* @license-end */
TEGO.h
Go to the documentation of this file.
1/* --- Ansi C --- */
3// Copyright (C) 2019 CEA/DEN
4//
5// This program is free software: you can redistribute it and/or
6// modify it under the terms of the GNU Lesser General Public License
7// as published by the Free Software Foundation, either version 3 of
8// the License, or any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public
16// License along with this program.
17// if not, see <http://www.gnu.org/licenses/>.
19
28#ifndef __EGO__
29#define __EGO__
30
31#define ID_EGO 0
32
33// ROOT
34#include "Rtypes.h"
35#include "TNamed.h"
36#include "TRandom.h"
37
38// Uranie
39#include "TOptimShare.h"
40
41#include "TDataServer.h"
42#include "TAttribute.h"
43#include "TKriging.h"
44#include "TRun.h"
45#include "TEval.h"
46#include "TOptimFit.h"
47#include "TFitGetter.h"
48#include "TVizir2.h"
49
50// mark
51#define EMPTY 0
52#define FILL 1
53#define PENDING 2
54#define EVALUATED 3
55
56
57namespace URANIE {
58namespace MetaModelOptim {
59
61{
62public:
64 virtual ~TEgoModeler() {};
65
66 virtual void build(URANIE::DataServer::TDataServer *, URANIE::Reoptimizer::TFitGetter *,
67 vector<URANIE::DataServer::TAttribute*>&,
68 URANIE::DataServer::TAttribute *, URANIE::DataServer::TAttribute *,
69 double *, int
70 ) = 0;
71 virtual URANIE::Modeler::TKriging *next(vector<char> &,
72 vector<vector<URANIE::DataServer::UEntry*>> &, int) = 0;
73
75};
76
78{
79public:
81 virtual ~TEgoSolver() {};
82
83 virtual void significantEI(double) = 0;
84
85 virtual void build(URANIE::Relauncher::TRun *,
86 vector<URANIE::DataServer::TAttribute*>&, URANIE::DataServer::TAttribute *) = 0;
87 virtual void next() = 0;
88 virtual void more() = 0;
89 virtual int getNext(long, int, vector<vector<URANIE::DataServer::UEntry*>> &,
90 vector<char> &) = 0;
91
93};
94
95class TEGO : public URANIE::Reoptimizer::TOptimShare
96{
97protected:
98 int _NK, _NC, _NR;
99 URANIE::DataServer::TAttribute *_y;
100 URANIE::Reoptimizer::TFitGetter *_crit;
103
104 // solver helper method
105 int copyTDSin(vector<URANIE::DataServer::TAttribute*>& in,
106 URANIE::DataServer::TDataServer *tds,
107 vector<vector<URANIE::DataServer::UEntry*>> &tab,
108 vector<char> &mark);
109 int copyTDSall(URANIE::DataServer::TDataServer *tds,
110 vector<vector<URANIE::DataServer::UEntry*>> &tab,
111 vector<char> &mark);
112 int init_sampling(vector<URANIE::DataServer::TAttribute*>& in,
113 vector<vector<URANIE::DataServer::UEntry*>> &sampl,
114 vector<char> &mark);
115 int reuse_sampling(vector<URANIE::DataServer::TAttribute*>& in,
116 URANIE::DataServer::TDataServer *tds,
117 vector<vector<URANIE::DataServer::UEntry*>> &sampl,
118 vector<char> &mark, bool done);
119 void prepareInput(vector<URANIE::DataServer::UEntry*> *sampl,
120 vector<URANIE::DataServer::UEntry*> *in);
121 void fillSample(long ev, vector<URANIE::DataServer::UEntry*> *in,
122 vector<URANIE::DataServer::UEntry*> *out,
123 vector<URANIE::DataServer::UEntry*> *sampl);
124 double fillWithExpectedValue(vector<char> *mark,
125 vector<URANIE::DataServer::UEntry*> *sampl,
126 URANIE::DataServer::TDataServer &tds2, URANIE::Modeler::TKriging *krig);
127
128
129public :
130 TEGO(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run);
131 TEGO(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TEval *eval);
132 virtual ~TEGO();
133
134 // initialisation
135 void setModeler(TEgoModeler *);
136 void setSolver(TEgoSolver *);
137 virtual void addObjective(URANIE::DataServer::TAttribute *,
138 URANIE::Reoptimizer::TOptimFit *f = NULL);
139 void setSize(int, int);
140
141 // solve
142 virtual void solverLoop();
143
145};
146
147//
148int egocrit(double* in, double *out, void *info);
149int krigeage(double *in, double *out, void *info);
150
151
152
153} } //namespace
154
155#endif
#define ID_EGO
Definition TEGO.h:31
Definition TEGO.h:96
int reuse_sampling(vector< URANIE::DataServer::TAttribute * > &in, URANIE::DataServer::TDataServer *tds, vector< vector< URANIE::DataServer::UEntry * > > &sampl, vector< char > &mark, bool done)
Definition TEGO.cxx:225
int _NK
Definition TEGO.h:98
void setSolver(TEgoSolver *)
Definition TEGO.cxx:130
int init_sampling(vector< URANIE::DataServer::TAttribute * > &in, vector< vector< URANIE::DataServer::UEntry * > > &sampl, vector< char > &mark)
Definition TEGO.cxx:199
int copyTDSin(vector< URANIE::DataServer::TAttribute * > &in, URANIE::DataServer::TDataServer *tds, vector< vector< URANIE::DataServer::UEntry * > > &tab, vector< char > &mark)
Definition TEGO.cxx:138
virtual void addObjective(URANIE::DataServer::TAttribute *, URANIE::Reoptimizer::TOptimFit *f=NULL)
Definition TEGO.cxx:115
void setSize(int, int)
Definition TEGO.cxx:108
double fillWithExpectedValue(vector< char > *mark, vector< URANIE::DataServer::UEntry * > *sampl, URANIE::DataServer::TDataServer &tds2, URANIE::Modeler::TKriging *krig)
int copyTDSall(URANIE::DataServer::TDataServer *tds, vector< vector< URANIE::DataServer::UEntry * > > &tab, vector< char > &mark)
Definition TEGO.cxx:166
void fillSample(long ev, vector< URANIE::DataServer::UEntry * > *in, vector< URANIE::DataServer::UEntry * > *out, vector< URANIE::DataServer::UEntry * > *sampl)
Definition TEGO.cxx:258
URANIE::Reoptimizer::TFitGetter * _crit
Definition TEGO.h:100
void setModeler(TEgoModeler *)
Definition TEGO.cxx:125
virtual void solverLoop()
Definition TEGO.cxx:277
TEgoModeler * _model
Definition TEGO.h:102
int _NC
Definition TEGO.h:98
void prepareInput(vector< URANIE::DataServer::UEntry * > *sampl, vector< URANIE::DataServer::UEntry * > *in)
Definition TEGO.cxx:246
TEgoSolver * _solv
Definition TEGO.h:101
URANIE::DataServer::TAttribute * _y
Definition TEGO.h:99
TEGO(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TEval *eval)
int _NR
Definition TEGO.h:98
virtual ~TEGO()
Definition TEGO.cxx:101
TEgoModeler()
Definition TEGO.h:63
virtual URANIE::Modeler::TKriging * next(vector< char > &, vector< vector< URANIE::DataServer::UEntry * > > &, int)=0
virtual ~TEgoModeler()
Definition TEGO.h:64
virtual void build(URANIE::DataServer::TDataServer *, URANIE::Reoptimizer::TFitGetter *, vector< URANIE::DataServer::TAttribute * > &, URANIE::DataServer::TAttribute *, URANIE::DataServer::TAttribute *, double *, int)=0
virtual void significantEI(double)=0
virtual ~TEgoSolver()
Definition TEGO.h:81
virtual int getNext(long, int, vector< vector< URANIE::DataServer::UEntry * > > &, vector< char > &)=0
TEgoSolver()
Definition TEGO.h:80
virtual void build(URANIE::Relauncher::TRun *, vector< URANIE::DataServer::TAttribute * > &, URANIE::DataServer::TAttribute *)=0
int krigeage(double *in, double *out, void *info)
int egocrit(double *in, double *out, void *info)
Definition TEGO.h:57