Description
The MultiWeightSwitchCSVGen Generator reads metadata from a CSV file to map multiple MultiWeightGen Generators into memory via a key. The key allows it to switch between its MultiWeightGens. A percentage mapped to each key allows each MulitWeightGen to calculate its weight amongst the other MultiWeightGens.
For example, if the vertical loopCount equals 10,000, from the example data below, key IL with a percent of 83.83 will calculate its mapped MultiWeighGen's loopCount to be 8,383 of the 10,000.
- Row 1, Col 3 on, defines the horizontal keys mapped within each MultiWeightGen
- Row 2, Col 1 on, defines the vertical keys that will map each MultiWeightGen
- Row 2, Col 1, defines the percentage used to calculate its mapped MultiWeightGens' loopCount
- Row 2, Col 3 on, defines the percentages mapped within each MultiWeightGen
- Row 1, Col 1 & Col 2 are ignored; they may have values or no values
Example CSV file metadata
- Key,%,Yes,No,Undecided
- IL, 83.83, 90, 7, 3
- CA, 12.30, 8, 90, 2
- FL, 3.01, 10, 40, 50
- DC, 0.7, 50, 20, 30
- MA, 0.16, 45, 35, 20
Parameters
The following parameters may be configured for the MultiWeightCSVGen Generator. Items with an asterisk* are required.
- switch* - References an Attribute whose generated value will be used as the switch.
- filePath* - Defines the path where the CSV file is located.
- fileSubDir - Defines an optional subdirectory under the filePath where the CSV file is located.
- fileName* - Defines the name of the CSV file.
- seed - Defines a seed value to ensure that the same random data is generated each time data is generated.
- delimiter* - Defines the delimiter used to separate the column data within the CSV file. The default is a comma.
- exactPercentage* - When exactPercentage is true, the random distribution matches the specified percentages. When exactPercentage is false, the random distribution is determined in real-time and may not match exact percentages; however, the larger the distribution, the more accurate the percentage will be.
- noGenReference - References an Attribute whose generated value must return True or False. When True, the switch will be ignored, and no MultiWeightGen will be selected to generate data. Instead, the value generated from noGenValue Attribute will be returned.<br><br>Since this parameter is optional, the default behavior is False, and the switch will be used to select one of the mapped MultiWeightGen Generators.
- noGenValue - References a constant value or an Attribute whose generated value will be returned whenever the value of the noGenReference parameter is True.
- list - Stores one value on each line in the list. To add values, type them in and hit ENTER. Note that the listed value shown is only for simulation mode; when running a true Scenario, the data will be loaded from the specified resource.