English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / MetaModelOptim: THJMA.h Source File
Uranie / MetaModelOptim v4.9.0
/* @license-end */
THJMA.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
27#ifndef __HJMA__
28#define __HJMA__
29
30// ROOT
31#include "Rtypes.h"
32#include "TRandom3.h"
33
34// URANIE
35#include "TOptimShare.h"
36
37#include "TDataServer.h"
38#include "TAttribute.h"
39#include "TRun.h"
40#include "TEval.h"
41#include "TOptimFit.h"
42#include "TFitGetter.h"
43
44#include "TEGO.h"
45
46struct domain {
47 double mini, maxi, it;
48};
49struct hjma_pt {
50 double *xy;
51 vector<URANIE::DataServer::UEntry*> *codi, *codo;
52};
53struct hjma_work {
54 struct hjma_pt *best, *cur, one, two;
55};
56struct hjma_mem {
57 double crit;
58 vector<URANIE::DataServer::UEntry*> data;
59};
60
61namespace URANIE {
62namespace MetaModelOptim {
63
64class THJMA : public URANIE::Reoptimizer::TOptimShare
65{
66private:
67 inline double evaluate_pt(struct hjma_pt &pt);
68 inline void evaluate_best(struct hjma_work &self);
69 inline bool evaluate_current(struct hjma_work &self);
70
71
72protected:
75 URANIE::DataServer::TAttribute *_y;
76 URANIE::Reoptimizer::TFitGetter *_crit, *_valid;
77 TRandom3 _rnd;
78 double **_global;
79 std::vector<double *> *_mode;
80 struct domain *_dom;
81
82 void build();
83 void globalsearch(struct hjma_work &self);
84 int hjonestep(struct hjma_work &self, double *dep, double step);
85 void hjtwostep(struct hjma_work &self, double *dep);
86 int hjsearch(struct hjma_work &self, double prox, int loop, int dup);
87 int duplicate(struct hjma_work &self, double it);
88 void addSolution(struct hjma_work &self);
89 int getBest(struct hjma_work &self);
90
91
92public:
93 THJMA(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run);
94 virtual ~THJMA();
95
96 // initialisation
97 virtual void addObjective(URANIE::DataServer::TAttribute *,
98 URANIE::Reoptimizer::TOptimFit *f=NULL);
99 void setUsable(URANIE::Reoptimizer::TOptimFit *);
100 void setSize(int first, int step);
101
102 // solve
103 void fitnessChanged();
104 virtual void solverLoop();
105
106 // post
107 double *item(int);
108
110};
111
112} } //namespace
113
114#endif
efficient global optimization algorithm
#define ID_EGO
Definition TEGO.h:31
Definition THJMA.h:65
int _Nstep
Definition THJMA.h:73
void globalsearch(struct hjma_work &self)
Definition THJMA.cxx:191
int getBest(struct hjma_work &self)
Definition THJMA.cxx:384
double evaluate_pt(struct hjma_pt &pt)
Definition THJMA.cxx:156
URANIE::Reoptimizer::TFitGetter * _valid
Definition THJMA.h:76
int _update
Definition THJMA.h:74
void hjtwostep(struct hjma_work &self, double *dep)
Definition THJMA.cxx:273
virtual void addObjective(URANIE::DataServer::TAttribute *, URANIE::Reoptimizer::TOptimFit *f=NULL)
Definition THJMA.cxx:100
TRandom3 _rnd
Definition THJMA.h:77
double * item(int)
Definition THJMA.cxx:483
std::vector< double * > * _mode
Definition THJMA.h:79
int hjsearch(struct hjma_work &self, double prox, int loop, int dup)
Definition THJMA.cxx:303
int _Ncut
Definition THJMA.h:73
void setSize(int first, int step)
Definition THJMA.cxx:117
void evaluate_best(struct hjma_work &self)
Definition THJMA.cxx:168
void addSolution(struct hjma_work &self)
Definition THJMA.cxx:357
virtual ~THJMA()
Definition THJMA.cxx:80
bool evaluate_current(struct hjma_work &self)
Definition THJMA.cxx:173
int _Ncall
Definition THJMA.h:73
int duplicate(struct hjma_work &self, double it)
Definition THJMA.cxx:335
int hjonestep(struct hjma_work &self, double *dep, double step)
Definition THJMA.cxx:229
int _first
Definition THJMA.h:74
double ** _global
Definition THJMA.h:78
URANIE::Reoptimizer::TFitGetter * _crit
Definition THJMA.h:76
int _Nfirst
Definition THJMA.h:73
virtual void solverLoop()
Definition THJMA.cxx:407
URANIE::DataServer::TAttribute * _y
Definition THJMA.h:75
void build()
Definition THJMA.cxx:125
struct domain * _dom
Definition THJMA.h:80
void fitnessChanged()
Definition THJMA.cxx:401
void setUsable(URANIE::Reoptimizer::TOptimFit *)
Definition THJMA.cxx:110
Definition TEGO.h:57
Definition THJMA.h:46
double it
Definition THJMA.h:47
double mini
Definition THJMA.h:47
double maxi
Definition THJMA.h:47
Definition THJMA.h:56
vector< URANIE::DataServer::UEntry * > data
Definition THJMA.h:58
double crit
Definition THJMA.h:57
Definition THJMA.h:49
double * xy
Definition THJMA.h:50
vector< URANIE::DataServer::UEntry * > * codi
Definition THJMA.h:51
vector< URANIE::DataServer::UEntry * > * codo
Definition THJMA.h:51
Definition THJMA.h:53
struct hjma_pt one
Definition THJMA.h:54
struct hjma_pt * best
Definition THJMA.h:54
struct hjma_pt * cur
Definition THJMA.h:54
struct hjma_pt two
Definition THJMA.h:54