<selectRandomNumbers/>
<selectRandomNumbers/> is a Math
component that generates document variants by selecting random numbers from a specified range of
values or within a normal distribution around a specified mean.
Attributes and Properties
| Attribute | Type | Values |
|---|---|---|
asList = "…" | "true" "false" | |
displayDecimals = "…" | ||
displayDigits = "…" | ||
displaySmallAsZero = "…" | ||
exclude = "…" | ||
from = "…" | number | |
mean = "…" | number | |
numToSelect = "…" | integer | |
padZeros = "…" | ||
standardDeviation = "…" | number | |
step = "…" | number | |
to = "…" | number | |
type = "…" | text | "uniform" "discreteuniform" "gaussian" |
variance = "…" | number |
| Property | Type |
|---|---|
$s.from | number |
$s.mean | number |
$s.numToSelect | integer |
$s.standardDeviation | number |
$s.step | number |
$s.to | number |
$s.type | text |
$s.variance | number |
Example: Default <selectRandomNumbers/>
Without any attributes specified, the default selection type is uniform, and the default interval is .
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: numToSelect
The <selectRandomNumbers/> component is used with the numToSelect attribute to select multiple
random values in the default interval . The default type is uniform.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Example: Assign descriptive names to selections
Three numbers are selected. Selections can be assigned more descriptive names by defining individual components which reference the selected values.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: from, to
The <selectRandomNumbers/> component is used with the from and the to attributes to modify the
default selection interval. The default type is uniform.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: type = “discreteUniform”
The type attribute of the <selectRandomNumbers/> component is specified as discreteUniform.
The discreteUniform selection generates values from an evenly spaced range defined by the
attributes to, from, and step. If left unspecified, the default step is 1.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: exclude
The type attribute of the <selectRandomNumbers/> component is specified
as discreteUniform. Values can be excluded from the specified range used with this type using the exclude attribute.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: step
The type attribute of the <selectRandomNumbers/> component is specified as discreteUniform.
The discreteUniform selection generates values from an evenly spaced range defined by the
attributes to, from, and step. If left unspecified, the default step is 1.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: type = “gaussian”
The type attribute of the <selectRandomNumbers/> component is
specified as gaussian. The gaussian selection generates standard normal
variables (mean 0, variance 1). Alternatively, the mean as well as the variance
or the standardDeviation attributes may be defined.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: gaussian with mean and variance
The type attribute of the <selectRandomNumbers/> component is specified
as gaussian. The gaussian selection generates standard normal variables (mean 0, variance 1). In
this example, the mean and the variance are defined with attributes.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.
Attribute Example: gaussian with mean and standardDeviation
The type attribute of the <selectRandomNumbers/> component is specified
as gaussian. The gaussian selection generates standard normal variables (mean 0, variance 1). In
this example, the mean and the standardDeviation are defined with attributes.
Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.