English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / ReOptimizer: TCMAES.h Source File
Uranie / ReOptimizer v4.9.0
/* @license-end */
TCMAES.h
Go to the documentation of this file.
1/* --- Ansi C --- */
3// Copyright (C) 2023 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 __CMAES__
28#define __CMAES__
29
30// ROOT
31//#include "Rtypes.h"
32#include "TRandom3.h"
33#include "TMatrixD.h"
34
35//URANIE
36#include "Reoptimizer.h"
37#include "TOptimShare.h"
38
39#include "TDataServer.h"
40#include "TAttribute.h"
41#include "TRun.h"
42#include "TEval.h"
43#include "TOptimFit.h"
44#include "TFitGetter.h"
45
46struct cmaes {
47 TMatrixD *corr;
48 //TMatrixD base(SIZE, SIZE);
49 TMatrixD *step;
50 TMatrixD *accu;
51 double stepg;
52};
53
54struct solution {
55 TMatrixD *aleas;
56 TMatrixD *point;
57 double fit;
58 int idx, nbe;
59};
60
61struct population {
62 struct solution *ind;
63 int etat, size;
64};
65
66struct domain {
67 double mini, maxi, it;
68};
69
70namespace URANIE {
71namespace Reoptimizer {
72
73class TCMAES : public TOptimShare
74{
75private:
76 void massCenter(TMatrixD &);
77 void moveCenter(TMatrixD &);
78 void b_from_corr(TMatrixD &bb, TMatrixD &bbb);
79 void add_population(struct solution &sol);
80 TMatrixD * (TCMAES::*_repair_point)(struct solution &sol);
81 TMatrixD *repair_point_unbound(struct solution &sol);
82 TMatrixD *repair_point_reflex(struct solution &sol);
83 TMatrixD *repair_point_reject(struct solution &sol);
84
85protected:
89 TRandom3 _mt;
90 URANIE::DataServer::TAttribute *_y;
93 struct cmaes _etat;
94 struct domain *_dom;
95
96 void initCmaesConst();
97 void initDomain();
98 void build();
99 void echo(TMatrixD &m);
100 void echoV(TMatrixD &v);
101 void initRandomPoint(TMatrixD &pt);
102 void push(int nbe, TMatrixD &pt, std::vector<URANIE::DataServer::UEntry*> *codi,
103 std::vector<URANIE::DataServer::UEntry*> *codo);
104 long pull(std::vector<struct solution> &gen,
105 std::vector<std::vector<URANIE::DataServer::UEntry*>> &codi,
106 std::vector<std::vector<URANIE::DataServer::UEntry*>> &codo,
107 std::vector<URANIE::DataServer::UEntry*> *sampl);
108 void fillSample(long i, URANIE::DataServer::TDataServer *tds,
109 std::vector<URANIE::DataServer::UEntry*> *codi,
110 std::vector<URANIE::DataServer::UEntry*> *codo,
111 std::vector<URANIE::DataServer::UEntry*> *sampl);
112
113
114public:
115 TCMAES(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run);
116 virtual ~TCMAES();
117
118 // initialisation
119 virtual void addObjective(URANIE::DataServer::TAttribute *,
121 void setSize(int loop, int step, int pop);
122 void setUnbounded();
123 void setRejectBound();
124 void setReflexBound();
125
126 // solve
128 virtual void solverLoop();
129
130 // post
131 double *item(int);
132
133 ClassDef(URANIE::Reoptimizer::TCMAES, ID_REOPTIMIZER)
134};
135
136} } //namespace
137
138#endif
recuperation de sortie transformées
objectifs et contraintes standards
methodes communes aux algo d optimisation
Definition TCMAES.h:74
void setReflexBound()
Definition TCMAES.cxx:103
double _ccovorig
Definition TCMAES.h:87
long pull(std::vector< struct solution > &gen, std::vector< std::vector< URANIE::DataServer::UEntry * > > &codi, std::vector< std::vector< URANIE::DataServer::UEntry * > > &codo, std::vector< URANIE::DataServer::UEntry * > *sampl)
Definition TCMAES.cxx:335
TRandom3 _mt
Definition TCMAES.h:89
void initDomain()
Definition TCMAES.cxx:124
virtual void solverLoop()
Definition TCMAES.cxx:391
TMatrixD * repair_point_reject(struct solution &sol)
Definition TCMAES.cxx:272
void echo(TMatrixD &m)
Definition TCMAES.cxx:186
double _cudcoef
Definition TCMAES.h:88
TMatrixD * repair_point_unbound(struct solution &sol)
Definition TCMAES.cxx:229
struct population _pop
Definition TCMAES.h:92
virtual void addObjective(URANIE::DataServer::TAttribute *, URANIE::Reoptimizer::TOptimFit *f=NULL)
Definition TCMAES.cxx:76
URANIE::DataServer::TAttribute * _y
Definition TCMAES.h:90
void setUnbounded()
Definition TCMAES.cxx:93
virtual ~TCMAES()
Definition TCMAES.cxx:70
double _ccovtest
Definition TCMAES.h:87
double _alpha
Definition TCMAES.h:88
int _Ncycle
Definition TCMAES.h:86
void initCmaesConst()
Definition TCMAES.cxx:109
TMatrixD * repair_point_reflex(struct solution &sol)
Definition TCMAES.cxx:242
void b_from_corr(TMatrixD &bb, TMatrixD &bbb)
Definition TCMAES.cxx:294
URANIE::Reoptimizer::TFitGetter * _crit
Definition TCMAES.h:91
void push(int nbe, TMatrixD &pt, std::vector< URANIE::DataServer::UEntry * > *codi, std::vector< URANIE::DataServer::UEntry * > *codo)
Definition TCMAES.cxx:315
TMatrixD *(TCMAES::* _repair_point)(struct solution &sol)
Definition TCMAES.h:80
void setRejectBound()
Definition TCMAES.cxx:98
void fillSample(long i, URANIE::DataServer::TDataServer *tds, std::vector< URANIE::DataServer::UEntry * > *codi, std::vector< URANIE::DataServer::UEntry * > *codo, std::vector< URANIE::DataServer::UEntry * > *sampl)
Definition TCMAES.cxx:556
void initRandomPoint(TMatrixD &pt)
Definition TCMAES.cxx:173
double _ccoef
Definition TCMAES.h:87
struct domain * _dom
Definition TCMAES.h:94
void add_population(struct solution &sol)
Definition TCMAES.cxx:353
void moveCenter(TMatrixD &)
Definition TCMAES.cxx:216
struct cmaes _etat
Definition TCMAES.h:93
double _Xi
Definition TCMAES.h:88
void echoV(TMatrixD &v)
Definition TCMAES.cxx:196
double _cbeta
Definition TCMAES.h:88
int _Nlambda
Definition TCMAES.h:86
void massCenter(TMatrixD &)
Definition TCMAES.cxx:204
void build()
Definition TCMAES.cxx:143
double _cucoef
Definition TCMAES.h:87
double _cdcoef
Definition TCMAES.h:88
URANIE::Reoptimizer::TFitGetter * _valid
Definition TCMAES.h:91
void setSize(int loop, int step, int pop)
Definition TCMAES.cxx:86
int _Nmu
Definition TCMAES.h:86
Definition TFitGetter.h:51
Definition TOptimFit.h:48
Definition TOptimShare.h:53
Definition TCMAES.h:70
Definition TCMAES.h:46
TMatrixD * corr
Definition TCMAES.h:47
double stepg
Definition TCMAES.h:51
TMatrixD * accu
Definition TCMAES.h:50
TMatrixD * step
Definition TCMAES.h:49
Definition TCMAES.h:66
double it
Definition TCMAES.h:67
double mini
Definition TCMAES.h:67
double maxi
Definition TCMAES.h:67
Definition TCMAES.h:61
int size
Definition TCMAES.h:63
struct solution * ind
Definition TCMAES.h:62
int etat
Definition TCMAES.h:63
Definition TCMAES.h:54
TMatrixD * point
Definition TCMAES.h:56
int nbe
Definition TCMAES.h:58
int idx
Definition TCMAES.h:58
TMatrixD * aleas
Definition TCMAES.h:55
double fit
Definition TCMAES.h:57