/** * Create a uniform distributed {@link LocationGenerator}. The min and max * values set to this builder take precedence over the mean and standard * deviations. In case the boundaries were set any specified means and * standard deviations are ignored when generating the locations. However, * the mean as supplied to this builder will be returned in the * {@link LocationGenerator#getCenter()} method. * @return A uniform distributed generator. */ public LocationGenerator buildUniform() { final Point xMinMax = getUniformMinMax(xMin, xMax, xMean, xSd); final Point yMinMax = getUniformMinMax(yMin, yMax, yMean, ySd); final Point min = new Point(xMinMax.x, yMinMax.x); final Point max = new Point(xMinMax.y, yMinMax.y); final double xCenter = getUniformCenter(xMean, min.x, max.x); final double yCenter = getUniformCenter(yMean, min.y, max.y); return new SupplierLocGen( min, max, new Point(xCenter, yCenter), uniformDouble(min.x, max.x), uniformDouble(min.y, max.y)); }
@Parameters public static List<Object[]> configs() { return asList(new Object[][] { {uniformDouble(0.5, 5.5)}, {uniformInt(0, 10)}, {uniformLong(-100, 100)}, {constant(new Object())}, {constant(100L)}, {normal().buildDouble()}, {normal().bounds(-1, 1).buildInteger()}, {normal().mean(100).std(50).buildLong()} }); }