English Français

Documentation / Developer's manual

Available modules

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

Description of a generation of sample by space filling (FAST). More...

#include <TSpaceFilling.h>

Inheritance diagram for URANIE::Sampler::TSpaceFilling:
Collaboration diagram for URANIE::Sampler::TSpaceFilling:

Public Types

enum  EFunction { kCukier , kSaltelliA , kSaltelliB }
 

Public Member Functions

Constructor and Destructor
 TSpaceFilling (URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t nCalcul, EFunction=TSpaceFilling::kSaltelliA)
 Constructor from a TDataServer, the name of the method and the size of the sample.
 
virtual ~TSpaceFilling ()
 Default destructor.
 
Setting and Getting global informations
void setSize (Int_t n)
 Sets the size of the matrice.
 
void setPermutation (Bool_t bpermute)
 Set the permutation attribute.
 
Bool_t getPermutation ()
 Get the permutation attribute.
 
Methods for the frequencies

The Fast method needs a vector a frequencies for each uncertainty attributes

void setDefaultFrequencies ()
 Sets the default frequencies by an algorithm.
 
void setFrequencies (Int_t nfreq, Int_t *valfreq)
 Sets the frequencies by an array.
 
Int_t getFrequency (Int_t i)
 Returns the frequency.
 
Methods for the fransformation

The Fast method needs also a function to transform data in [0,1]

void setTransformFunction (EFunction ntype)
 Sets the Transform fonction.
 
EFunction getTransformFunction ()
 Gets the transform function.
 
Generation of the sample
virtual 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::TSamplerDeterminist
 TSamplerDeterminist (URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t ns)
 Constructor with a dataserver.
 
virtual ~TSamplerDeterminist ()
 Default destructor.
 
- 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.
 
virtual void createTuple ()
 Creates the TDSNtupleD of data with only the TStochasticAttributes.
 
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 ()
 

Private Attributes

Int_t * _nValFreq
 
EFunction _nFunction
 The function G.
 
Bool_t _bPermutation
 the boolean to permute each attribute (default = kFALSE)
 

Additional Inherited Members

- 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 a generation of sample by space filling (FAST).

Method of sampling

Two methods are implemented

  • Cukier (1973) algorithm

    \[ x_{i} = \bar{x_{i}} \exp^{\bar{\gamma_i} \sin{(\omega_i s)}}\]

    For normalisation, we take $ \bar{x_{i}} = \exp^{-\bar{\gamma_i}}$ with $ \gamma_i = 1$ .
  • Saltelli A (1999)

    \[ x_{i} = \frac{1}{2} + \frac{1}{\pi} \arcsin{(\sin{(\omega_i s)})}\]

  • Saltelli B (1999)

    \[ x_{i} = \frac{1}{2} + \frac{1}{\pi} \arcsin{[\sin{(\omega_i s + \varphi_i)}]}\]

    where $ \varphi_i \in [0,2\pi)$ randomly.

Use case

First of all, a pointer to a TDataServer is constructed

TDataServer *tds = new TDataServer("tdsSpaceFilling", "Test for SpaceFilling");
tds->addAttribute( new TAttribute("x1", -1.0 , 2.) );
tds->addAttribute( new TAttribute("x2", 0.0 , 3.) );
tds->addAttribute( new TAttribute("x3", 1.0, 1.5) );

Then, a pointer to an object TSpaceFilling is constructed using the TDataServer, of the adopted sequence ("cukier"|"Saltelli A"|"Saltelli B"), and the method generateSample() is applied

TSpaceFilling * tsf = new TSpaceFilling(tdsqmc, "", 300, TSpaceFilling::kCukier);
Description of a generation of sample by space filling (FAST).
Definition TSpaceFilling.h:81
@ kCukier
Definition TSpaceFilling.h:87
virtual void generateSample(Option_t *option="")
Generates the sample.

Member Enumeration Documentation

◆ EFunction

Enumerator
kCukier 
kSaltelliA 
kSaltelliB 

Constructor & Destructor Documentation

◆ TSpaceFilling()

URANIE::Sampler::TSpaceFilling::TSpaceFilling ( URANIE::DataServer::TDataServer *  tds,
Option_t *  option,
Int_t  nCalcul,
EFunction  = TSpaceFilling::kSaltelliA 
)

Constructor from a TDataServer, the name of the method and the size of the sample.

Referenced by ClassImp().

◆ ~TSpaceFilling()

virtual URANIE::Sampler::TSpaceFilling::~TSpaceFilling ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ generateSample()

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

Generates the sample.

Todo:
FGA 2011-12-15 10:10:20 Pass the seed in the option "seed=123456" for the kSaltelliB Transformation

Implements URANIE::Sampler::TSampler.

Referenced by ClassImp().

◆ getFrequency()

Int_t URANIE::Sampler::TSpaceFilling::getFrequency ( Int_t  i)
inline

Returns the frequency.

References _nValFreq.

◆ getPermutation()

Bool_t URANIE::Sampler::TSpaceFilling::getPermutation ( )
inline

Get the permutation attribute.

References _bPermutation.

◆ getTransformFunction()

EFunction URANIE::Sampler::TSpaceFilling::getTransformFunction ( )
inline

Gets the transform function.

References _nFunction.

◆ printLog()

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

Prints the log.

Reimplemented from URANIE::Sampler::TSamplerDeterminist.

Referenced by ClassImp().

◆ setDefaultFrequencies()

void URANIE::Sampler::TSpaceFilling::setDefaultFrequencies ( )

Sets the default frequencies by an algorithm.

Referenced by ClassImp().

◆ setFrequencies()

void URANIE::Sampler::TSpaceFilling::setFrequencies ( Int_t  nfreq,
Int_t *  valfreq 
)

Sets the frequencies by an array.

Referenced by ClassImp().

◆ setPermutation()

void URANIE::Sampler::TSpaceFilling::setPermutation ( Bool_t  bpermute)
inline

Set the permutation attribute.

References _bPermutation.

◆ setSize()

void URANIE::Sampler::TSpaceFilling::setSize ( Int_t  n)
inline

Sets the size of the matrice.

References URANIE::Sampler::TSampler::_nS.

◆ setTransformFunction()

void URANIE::Sampler::TSpaceFilling::setTransformFunction ( EFunction  ntype)
inline

Sets the Transform fonction.

References _nFunction.

Member Data Documentation

◆ _bPermutation

Bool_t URANIE::Sampler::TSpaceFilling::_bPermutation
private

the boolean to permute each attribute (default = kFALSE)

Referenced by ClassImp(), getPermutation(), and setPermutation().

◆ _nFunction

EFunction URANIE::Sampler::TSpaceFilling::_nFunction
private

The function G.

Referenced by ClassImp(), getTransformFunction(), and setTransformFunction().

◆ _nValFreq

Int_t* URANIE::Sampler::TSpaceFilling::_nValFreq
private

Referenced by ClassImp(), and getFrequency().