Random Selectors
public class RandomSelectors
Content copied to clipboard
Contains ResultSelector's to be used with a java.util.stream.Stream as a collection operation.
Functions
scaledSd
Link copied to clipboard
static ResultSelector<T> scaledSd<T>(double meanPercent, double sdPercent)
Content copied to clipboard
Creates a result selector that randomly selects an element where the element index is selected with the formula: where randomSd generates a random number from a normal distribution with the parameters min/max/mean/sd
var resultIndex = randomSd(0, list.size() - 1, meanPercent * (list.size() - 1), sdPercent * list.size())
uniform
Link copied to clipboard
weighted
Link copied to clipboard
static ResultSelector<T> weighted<T>(ToDoubleFunction<T> weightExtractor)
Content copied to clipboard