--- myst: substitutions: bloc: python: 1-27 cpp: 4-5,8-28 console: python: 13-21 cpp: 15-23 --- (sampler_oat_toatdesign_simple_oat)= # Construction of a simple OAT {{doe}} The easiest way to create an OAT {{doe}} using `TOATDesign` is to proceed as follows: 1. create a dataserver with a list of attributes corresponding to the input factors; 2. set the default value of each attribute to the nominal value; 3. create a `TOATDesign` object, with the dataserver as first parameter; 4. define the **maximum range of variation** of the factors using the **`setRange`** function; 5. generate the OAT {{doe}} using the **`generateSample`** function. At this point, the dataserver contains an OAT {{doe}} where each factor of interest is modified twice. Below is an example: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/sampler/use_cases/" + language + "/samplingOAT." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc[language] + "\n" + "```" }} This example produces: {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/sampler/use_cases/" + language + "/samplingOAT.log" + "\n" + ":language: none\n" + ":lines: " + console[language] + "\n" + "```" }} In the example above, we have two input factors: x1 and x2. Their nominal values are respectively 0.0 and 10.0, and their maximum variation ranges are 2.0 and 40% of 10.0, i.e. 4.0. ```{tip} To indicate that the range of "x2" is a percentage of its nominal value, we simply need to set the third parameter of the **setRange** function to TRUE. This parameter is set to FALSE by default, which means that the value of the range is considered to be "absolute". ``` The generated OAT design thus contains 5 experiments: - the reference, where x1 and x2 are set to their nominal values; - two variations of x1, where it equals -1.0 and 1.0 while x2 remains equal to 10.0; - two variations of x2, where it equals 8.0 and 12.0 while x1 is set back to 0.0; It also contains two new attributes, automatically added by {{uranie}}: - **\_\_nominal_set\_\_:** identifies which set of nominal values is used as a reference. In this case, we have only one set, thus \_\_nominal_set\_\_'s value remains equal to 1. This is further discussed in [](#sampler_oat_toatdesign_multiple_sets) - **\_\_modified_att\_\_:** identifies which factor has been modified in the current experiment. The value is the index of the corresponding attribute in the dataserver. A value equal to -1 means that all the factors have their nominal values. ```{warning} The index of an attribute in the dataserver can be different from the one printed by the scan function, or inside an output file. To be certain to retrieve the correct number, always use the **`TDataServer::getAttributeIndex`** function. ```