Description
The MultiWeightGen Generator allows multiple values to be weighted to determine how often each value is generated. You can enter a percentage value or reference a value for the percentage.
For example, if a valueList contained (economy, midsize, and luxury) and the percentList contained (50, 35, and 15):
- economy would be generated 50% of the time
- midsize would be generated 35% of the time
- luxury would be generated 15% of the time
Note: It is best to have the percentages add up to 100%; however, the Generator has been designed to allow percentages greater than 100% in rare cases when needed.
In This Article
Training Video
The following video can be used to see a quick tutorial on how to use the MultiWeightGen Generator:
Generator Parameters
The following parameters may be configured for the MultiWeightGen Generator. Items with an asterisk* are required.
- valueList - Enter the desired values into the value list. Press ENTER to save each entry. If you need to change your entries, use the navigation commands on the right. Each value entered will be associated to the value in the percentList in the same position.
- percentList - Enter the desired percentages or add a reference for the associated values in the valueList into the list. Percentages MUST be integers. Press ENTER to save each entry. If you need to change your entries, use the navigation commands on the right.
- seed - Using the seed will ensure that the same random data is generated each time data is generated.
- exactPercentage* - When the exactPercentage is true, the random distribution matches exactly the percentages specified. When exactPercentage is false, the random distribution is determined in real time and may not match exact percentages. The larger the distribution, the more exact the percentage will be.
Example 1 - Generate Rental Vehicles by Percentage
If the Generator has not already been assigned, you must assign it to the Attribute. Please see this page for more details: How do I assign a Generator to a single Attribute?
Generator Configuration
- valueList Parameter - economy, midsize, luxury
- percentList Parameter - Enter each value that will be associated with the value in the valueList Parameter. For this example, we will use these values:
- economy = 50%
- midsize = 35%
- luxury = 15%
- seed - no value
- exactPercentage - True (ensures the percentage for each value will be matched precisely)
Sample Output
The data will appear similar to what is shown below. If 100 records are generated, the following percentages exist in the output data:
- economy (50 records) = 50%
- midsize (35 records) = 35%
- luxury (15 records) = 15%