User Tools

Site Tools


Sidebar

Translations of this page:
en

Index

en:traffic:documentation:integer

<Integer>

<Integer> == <Simple> || <IntInterval> || <IntSelection>

<IntInterval> == <Simple> - <Simple>

<IntSelection> == <IntSelItem> || <IntSelection> | <IntSelItem>

<IntSelItem> == <Simple> || <Simple> : <Simple>

<Integer> is a whole number which can be input directly or, alternatively, can be selected by a random number generator.

There are two methods by which a random number can be generated:

  • Interval: An interval is input by two <Simple> values separated by a hyphen (-). All of the values in the interval (that is, the beginning number and the final number as well as every number in between) have the same likelihood of being selected.
  • Selection: A selection consists of numbers input by the user, separated by the | sign.  All of the numbers have an equal probability of being selected.  

The probability that a number will be selected can be customized so that probabilities can be assigned to numbers.  The probabilities can be input before the number separated from the number with a colon ( :). The probability value is itself a <Simple> number.

It is possible to mix expressions: some numbers can have assigned probabilities in the same selection as numbers without probability assignments.  In such a case, numbers not assigned an explicit probability take the implicit probability of 1.

Examples:

4 Simple number.  Its value is always 4.
2-5 Interval.  The value corresponds to a random selection between 2, 3, 4 and 5. All 4  choices have an equal probability of 25%.
2|5|7 Selection.  The value corresponds to a random selection between 2, 5 and 7. All three choices have a probability of 33%.
3:2|4|5:6|8 Selection. The value corresponds to a random selection between 2, 4, 6 and 8. The 2 appears with a probability of 30%, the 4 with a probability of 10%, the 6 with a probability of 50% and the 8 with a probability of 10%.
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.
More information
en/traffic/documentation/integer.txt · Last modified: 2018/09/09 17:51 (external edit)