randomTriangularWith static method
Implementation
static double randomTriangularWith(double min, double max, double mode) {
final double u = (math.Random()).nextDouble();
final double d = max - min;
if (u <= (mode - min) / d) return min + math.sqrt(u * d * (mode - min));
return max - math.sqrt((1 - u) * d * (max - mode));
}