Description
The RangeGen Generator produces an increasing value from startRange to endRange or to long.MAX_VALUE when the end range is not specified. Once the endRange has been reached, the value is reset to the startRange.
In This Article
- Generator Parameters
- Example 1 - Start at a Specified Value
- Example 2 - Using the Iterate Parameter to Decide When to Increment the Next Value
- Example 3 - Incrementing Each Generated Value by 5
- Example 4 - Wait for 3 Iterations Before Incrementing the Value by 5
Generator Parameters
The following parameters may be configured for the RangeGen Generator. Items with an asterisk* are required.
- startRange* - Defines the initial starting value for the number generator.
- endRange - Defines the maximum value that may be generated before starting from the start range again. If the endRange value is not specified, it is set to long.MAX_VALUE.
- jumpAmount* - Defines the amount to add to the currently generated value.
- waitAmount* - Defines the number of iterations the Generator should wait before incrementing jumpAmount.
- iterate - Based on the Boolean value, determines when to generate next value. If the value is true, it generates next value. If the value is false, it just waits.
- sortOrder* - Determines the order in which the number will be generated. The choices are:
- ascending
- descending
Example 1 - Start at a Specified Value
The startRange parameter can be used when values generated by the RangeGen need to start at a specific value (e.g., 500).
Sample Output
Example 2 - Using the Iterate Parameter to Decide When to Increment the Next Value
The iterate parameter can be used to decide when to iterate to the next value. Any other Generator that generates a True/false value in a pattern can be used. The Attribute using the Generator or a Linked Generator can then be referenced in the iterate parameter.
In this example, the BooleanValueGen Generator has been linked and then referenced within the iterate Generator Parameter. It will generate a random true/false value, which will be used to determine when the startRange value will be incremented by 1.
BooleanValueGen Generator Configuration:
Sample Output
Each time "True" is generated, the value is incremented by 1.
Example 3 - Incrementing Each Generated Value by 5
In this example, the startRange has been set to 0 and will be incremented by 5 each time a value is generated. The endRange parameter has been set to 100. This means that the value will reset to 0 once 100 is reached.
Sample Output
Example 4 - Wait for 3 Iterations Before Incrementing the Value by 5
The waitAmount Parameter can be used to set the number of iterations to occur before the value is updated by the jumpAmount Parameter. In this example, three iterations will pass before the value is updated by 5.
Sample Output