English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sampler: URANIE::Sampler::TRafuSampling Class Reference
Uranie / Sampler v4.9.0
/* @license-end */
URANIE::Sampler::TRafuSampling Class Reference

Description of the class TRafuSampling. More...

#include <TRafuSampling.h>

Inheritance diagram for URANIE::Sampler::TRafuSampling:
Collaboration diagram for URANIE::Sampler::TRafuSampling:

Public Types

enum  EProbaSampling { kLHS , kSRS , kUnknown }
 
enum  EPossibSampling { kRandom , kSampling0 , kSampling1 }
 

Public Member Functions

Constructor and Destructor
 TRafuSampling (URANIE::DataServer::TDataServer *tds, Option_t *option="proba=lhs, possib=random_sampling", Int_t sampleSize=1000)
 
virtual ~TRafuSampling ()
 Default destructor.
 
Treats the TAttributes
virtual void createListOfPossibilityAttributes ()
 Creates the List of fuzzy attributes to sample

 
virtual void fillSunsetInputFile ()
 Constructs the input file for the Sunset software.
 
virtual TString buildProbabilityModule (URANIE::DataServer::TStochasticAttribute *att, const char *indentation)
 Generates the sunset module for the given TStochasticAttribute.
 
virtual TString buildPossibilityModule (URANIE::DataServer::TPossibilityAttribute *att, const char *indentation)
 Generates the sunset module for the given TPossibilityAttribute.
 
Generate the sample
virtual void createTuple ()
 Creates the TTree containing the generated sample.
 
void generateSample (Option_t *option="")
 Generates the sample.
 
Printing Log
virtual void printLog (Option_t *option="")
 Prints the log.
 
- Public Member Functions inherited from URANIE::Sampler::TSampler
 TSampler (URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t nCalcul)
 Constructor with a TDataServer, the options and the size of the sample.
 
virtual ~TSampler ()
 Default destructor.
 
Int_t GetID ()
 Returns the ID of the class.
 
void setMethodName (TString str)
 Sets the method name in a global variable.
 
TString getMethodName ()
 Gets the method name.
 
virtual URANIE::DataServer::TDataServer * getTDS ()
 Return the TDS filling by the sampling algorithm.
 
void parseOption (Option_t *option)
 Parse the option.
 
virtual void createListOfAttributes ()
 Creates the List of attributes to simulate.
 
URANIE::DataServer::TDSNtupleD * getTuple ()
 Returns the TDSNtupleD of data.
 
virtual void fillOtherAttributes ()
 Fills the TDSNtupleD of data with other TFormulaAttributes.
 
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 

Public Attributes

EProbaSampling _nProbaSampling
 The type of sampling for the probability (SRS, LHS)
 
EPossibSampling _nPossibSampling
 The type of sampling for the possibility (random, 0, 1)
 
Int_t _nPossib
 number of TPossibilityAttribute to sample
 
TList * _lstOfPossibilityAttributesToSample
 The list of TPossibilityAttribute to sample.
 
TString _sunsetInputFileName
 Name of the sunset input file name.
 
TString _sunsetInfFileName
 Name of the sunset inf output file name.
 
TString _sunsetSupFileName
 Name of the sunset sup output file name.
 
- Public Attributes inherited from URANIE::Sampler::TSampler
Int_t _nS
 The size of the sample.
 
Int_t _nX
 The size of attributes to sample.
 
URANIE::DataServer::TDSNtupleD * _ntsample
 the tntuple of data
 
TString _sMethod
 The title of the sampler method.
 
Bool_t _blog
 Log Printing.
 
Bool_t _bupdateFile
 Update the back up file when generating the attributeformula if there is some.
 
URANIE::DataServer::TDataServer * _tds
 Pointer to a TDS.
 
TList * _lstOfAttributesToSample
 The list of Stochastic Attributes to sample.
 

Detailed Description

Description of the class TRafuSampling.

This class defines a TSampler object for the RaFu method.

The RaFu method applies fuzzy logic to uncertainty propagation (citation needed). To achieve this, for each fuzzy variable, one has to compute an interval inside which the real value is likely to lie. This "likelyness" is the "possibility" of the interval and can be interpreted as the level of risk taken when choosing a value inside the corresponding interval (0 = low risk, 1 = high risk).

The goal of this sampler object is to use the IRSN code Sunset to generate a sampling containing fuzzy variables. The generated data will then be stored in a Data Server and used for uncertainty propagation and data analysis.

The current implementation creates a text file for the Sunset software, launch Sunset to generate the data, and retrieve the results.

Sunset generates 2 output files (one for each bound of the possibility intervals). The TRafuSampling object will join these two data set and store them in the Data Server. However, an attribute called s__rafu__dataset__ (where "%s" is the name of the TDataServer object) is given to distinguish the two. It equals to -1.0 for the lower bound, and +1.0 for the upper bound.

Member Enumeration Documentation

◆ EPossibSampling

Enumerator
kRandom 
kSampling0 
kSampling1 

◆ EProbaSampling

Enumerator
kLHS 
kSRS 
kUnknown 

Constructor & Destructor Documentation

◆ TRafuSampling()

URANIE::Sampler::TRafuSampling::TRafuSampling ( URANIE::DataServer::TDataServer *  tds,
Option_t *  option = "proba=lhs, possib=random_sampling",
Int_t  sampleSize = 1000 
)

Creates a TRafuSampling object from a TDataServer, a sampling method and the size of the sample to generate

The random variables to sample are the attributes of the TDataServer. These attributes must derive from the TStochasticAttribute and TPossibilityAttribute classes. The sampling method for the TStochasticAttribute objects can be either "proba=lhs" (Latin Hypercube Sampling) or "proba=srs" (Simple Random Sampling). If none of these is given, "proba=lhs" is chosen. The sampling method for the TPossibilityAttribute objects can be either "possib=random_interval" (random possibility), "possib=interval_sampling0" (possibility fixed to 0) or "possib=interval_sampling1" (possibility fixed to 1). If none of these is given, "possib=random_sampling" is chosen.

Parameters
tds(TDataServer *) pointer to the TDataServer.
option(Option_t *) option string containing the sampling method for random variables ("proba=") and fuzy variables ("possib=") (Default = "proba=lhs, possib=random_sampling").
sampleSize(Int_t) number of values to generate for each random variable (Default = 1000).
Exceptions
UErrorExceptionsif the DataServer doesn't contain any stochastic attribute AND possibility sampling is different from "random_interval"

Referenced by ClassImp().

◆ ~TRafuSampling()

virtual URANIE::Sampler::TRafuSampling::~TRafuSampling ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ buildPossibilityModule()

virtual TString URANIE::Sampler::TRafuSampling::buildPossibilityModule ( URANIE::DataServer::TPossibilityAttribute *  att,
const char *  indentation 
)
virtual

Generates the sunset module for the given TPossibilityAttribute.

In a Sunset input file, the details of the attribute are stored in a "module". This function create a TString containing the definition of this module.

Parameters
att(TStochasticAttribute *) the attribute which details are used to build the module string
indentation(char *) for aesthetical reason, this parameter provides the level of indentation of the module.
Exceptions
UErrorExceptionsif the type of the attribute is not supported.

Referenced by ClassImp().

◆ buildProbabilityModule()

virtual TString URANIE::Sampler::TRafuSampling::buildProbabilityModule ( URANIE::DataServer::TStochasticAttribute *  att,
const char *  indentation 
)
virtual

Generates the sunset module for the given TStochasticAttribute.

In a Sunset input file, the details of the attribute are stored in a "module". This function create a TString containing the definition of this module.

Parameters
att(TStochasticAttribute *) the attribute which details are used to build the module string
indentation(char *) for aesthetical reason, this parameter provides the level of indentation of the module.
Exceptions
UErrorExceptionsif the type of the attribute is not supported.

Referenced by ClassImp().

◆ createListOfPossibilityAttributes()

virtual void URANIE::Sampler::TRafuSampling::createListOfPossibilityAttributes ( )
virtual

Creates the List of fuzzy attributes to sample

Retrieve the list of TPossibilityAttribute objects stored in the TDataServer.

Referenced by ClassImp().

◆ createTuple()

virtual void URANIE::Sampler::TRafuSampling::createTuple ( )
virtual

Creates the TTree containing the generated sample.

Reimplemented from URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ fillSunsetInputFile()

virtual void URANIE::Sampler::TRafuSampling::fillSunsetInputFile ( )
virtual

Constructs the input file for the Sunset software.

This function create and fill the file containing all details to command Sunset to generate a sampling of probability and possibility variables.

Referenced by ClassImp().

◆ generateSample()

void URANIE::Sampler::TRafuSampling::generateSample ( Option_t *  option = "")
virtual

Generates the sample.

Creates the input file for Sunset, calls Sunset, retrieves the results and stores them in the TDataServer.

Parameters
option(Option_t *) option string (Default = "")

Implements URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Sampler::TRafuSampling::printLog ( Option_t *  option = "")
virtual

Prints the log.

Parameters
option(Option_t *) option string (Default = "")

Reimplemented from URANIE::Sampler::TSampler.

Referenced by ClassImp().

Member Data Documentation

◆ _lstOfPossibilityAttributesToSample

TList* URANIE::Sampler::TRafuSampling::_lstOfPossibilityAttributesToSample

The list of TPossibilityAttribute to sample.

Referenced by ClassImp().

◆ _nPossib

Int_t URANIE::Sampler::TRafuSampling::_nPossib

number of TPossibilityAttribute to sample

Referenced by ClassImp().

◆ _nPossibSampling

EPossibSampling URANIE::Sampler::TRafuSampling::_nPossibSampling

The type of sampling for the possibility (random, 0, 1)

Referenced by ClassImp().

◆ _nProbaSampling

EProbaSampling URANIE::Sampler::TRafuSampling::_nProbaSampling

The type of sampling for the probability (SRS, LHS)

Referenced by ClassImp().

◆ _sunsetInfFileName

TString URANIE::Sampler::TRafuSampling::_sunsetInfFileName

Name of the sunset inf output file name.

Referenced by ClassImp().

◆ _sunsetInputFileName

TString URANIE::Sampler::TRafuSampling::_sunsetInputFileName

Name of the sunset input file name.

Referenced by ClassImp().

◆ _sunsetSupFileName

TString URANIE::Sampler::TRafuSampling::_sunsetSupFileName

Name of the sunset sup output file name.

Referenced by ClassImp().