Class WeightedRandomSelection
- Namespace
- Weighted
Randoms
- Assembly
- WeightedRandoms.dll
The WeightedRandomSelection class provides a method for selecting an item from a list based on a weighted random selection algorithm. The weights are calculated based on a normal distribution with the peak at a specified percentage position in the range and with a specified height for the center that adjusts the shape of the curve. The width of the normal distribution can also be adjusted using a specified scaling factor.
- Inheritance
-
Weighted
Random Selection
- Inherited Members
Methods
SelectItem<T>(List<T>, double, double, double)
public static T SelectItem<T>(List<T> items, double centerPercentage, double centerHeight, double scaleFactor)
Parameters
Returns
- T
Type Parameters
T