English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / XmlProblem: TXMLProblem.h Source File
Uranie / XmlProblem  v4.10.0
/* @license-end */
TXMLProblem.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
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 
44 #ifndef TXMLPROBLEM_H
45 #define TXMLPROBLEM_H
46 // ROOT
47 #include <TXMLNode.h>
48 
49 #include "XMLProblem.h"
50 #include "TDataServer.h"
51 #include "TBaseModel.h"
52 
53 //STL
54 #include <vector>
55 
56 //typedef struct {
57 // int value;
58 // std::string msg;
59 //} UranieError;
60 
61 namespace URANIE
62 {
63 namespace XMLProblem
64 {
65 
66 class TXMLProblem: public TNamed
67 {
68 private:
69  Bool_t _blog;
70  Int_t _ndebuglevel;
71  Int_t _ntask;
72  URANIE::DataServer::TDataServer* _tds;
73  URANIE::DataServer::TDataServer* _tdsdatafield;
74  vector<TBaseModel *> _vectorOfModels;
75  TList * _listOfToDo;
76 
77 protected:
78  //---------------------------------------------
82  virtual void parseNodeHeader(TXMLNode *);
85  virtual void parseNodeDataDictionary(TXMLNode *);
87  virtual void parseNodeDataField(TXMLNode *);
89  virtual void parseNodePatterns(TXMLNode *, TBaseModel *);
91  virtual TString parseNodePatternSelected(TXMLNode *);
93  virtual void parseNodeModelerAlgorithm(TXMLNode *, TBaseModel *);
95 
96  //---------------------------------------------
100  void parseAndRunNodeLauncher(TXMLNode *);
103 
104  //---------------------------------------------
108  void parseAndRunNodeSampler(TXMLNode *);
111 
112  //---------------------------------------------
116  void parseAndRunNodeModeler(TXMLNode *);
118 #ifdef WITH_OPT
119  virtual void parseAndRunNodeModelerANN(TXMLNode *, TBaseModel *);
121 #endif
122  virtual void parseAndRunNodeModelerLinearRegression(TXMLNode *,
124  TBaseModel *);
126 
127 public:
128  //---------------------------------------------
132  TXMLProblem();
135  TXMLProblem(TString filename, Bool_t blog = kFALSE);
137  virtual ~TXMLProblem();
139 
140  //---------------------------------------------
144  Int_t getLevelDebug()
146  {
147  return _ndebuglevel;
148  }
150  void setLevelDebug(Int_t val)
151  {
152  _ndebuglevel = val;
153  }
154  // Gets the dataserver
155  URANIE::DataServer::TDataServer* getDataServer()
156  {
157  return _tds;
158  }
160 
161  //---------------------------------------------
165  Int_t parseFile(TString filename);
168 
169  //---------------------------------------------
173  virtual void init(Option_t *option = "");
176  virtual void run(Option_t *option = "");
178  virtual void terminate(Option_t *option = "");
180  virtual void clean(Option_t *option = "");
186  void addInfoTask(TString sname, TString stitle);
188 
189  //---------------------------------------------
193  void setLog()
194  {
195  _blog = kTRUE;
196  }
197  void unsetLog()
198  {
199  _blog = kFALSE;
200  }
201  void changeLog()
202  {
203  _blog = _blog ? kFALSE : kTRUE;
204  }
205  Bool_t getLog()
206  {
207  return _blog;
208  }
209  virtual void printLog(Option_t *option = "");
211 
212  ClassDef(URANIE::XMLProblem::TXMLProblem, ID_XMLPROBLEM)
213  //Classe de
214 };
215 
216 } // Fin du namespace XMLProblem
217 } // Fin du namespace URANIE
218 #endif
Definition: TBaseModel.h:56
URANIE::DataServer::TDataServer * getDataServer()
Definition: TXMLProblem.h:155
void setLog()
Definition: TXMLProblem.h:193
Bool_t getLog()
Definition: TXMLProblem.h:205
URANIE::DataServer::TDataServer * _tds
The Data Server.
Definition: TXMLProblem.h:72
virtual void parseNodeDataDictionary(TXMLNode *)
Parses the node "DataDictionary".
Interface of the class URANIE::XMLProblem::TBaseModel.
virtual void run(Option_t *option="")
Runs phase of the code.
Int_t parseFile(TString filename)
Reads XML data.
void addInfoTask(TString sname, TString stitle)
add Informations the the Task List to do
Int_t _ndebuglevel
Level of debug.
Definition: TXMLProblem.h:70
virtual void parseNodeDataField(TXMLNode *)
Parses the node "DataDictionary/DataField".
virtual ~TXMLProblem()
Default destructor.
virtual void parseNodeModelerAlgorithm(TXMLNode *, TBaseModel *)
Parses the node "modeler/algorithm".
void setLevelDebug(Int_t val)
Sets the debug level.
Definition: TXMLProblem.h:150
Bool_t _blog
Log Printing.
Definition: TXMLProblem.h:69
TList * _listOfToDo
Definition: TXMLProblem.h:75
URANIE::DataServer::TDataServer * _tdsdatafield
The Data Server.
Definition: TXMLProblem.h:73
void parseAndRunNodeModeler(TXMLNode *)
Parse and run the node "Modeler".
Int_t _ntask
The iterator of the task to do.
Definition: TXMLProblem.h:71
void changeLog()
Definition: TXMLProblem.h:201
virtual void init(Option_t *option="")
Initial phase of the code.
Description of the class TXMLProblem.
Definition: TXMLProblem.h:66
virtual void parseNodeHeader(TXMLNode *)
Parses the node "description".
void parseAndRunNodeLauncher(TXMLNode *)
Parses and runs the node "Launcher".
virtual void clean(Option_t *option="")
Cleans the working directory of the code.
virtual void parseAndRunNodeModelerLinearRegression(TXMLNode *, TBaseModel *)
Parse the node "Modeler/LinearRegression".
virtual TString parseNodePatternSelected(TXMLNode *)
Parses the node "models/patterns/select".
TXMLProblem()
Default constructor.
vector< TBaseModel * > _vectorOfModels
The vector of Models.
Definition: TXMLProblem.h:74
virtual void parseNodePatterns(TXMLNode *, TBaseModel *)
Parses the node "models/model".
virtual void printLog(Option_t *option="")
Description of the class TBaseModel.
Definition: TBaseModel.h:60
virtual void terminate(Option_t *option="")
Terminates phase of the code.
Int_t getLevelDebug()
Gets the debug level.
Definition: TXMLProblem.h:145
void parseAndRunNodeSampler(TXMLNode *)
Parses and Runs the node "sampler".
void unsetLog()
Definition: TXMLProblem.h:197