}
public static List<Vector2D> makeBlobs(int samples, int centers, double clusterStd,
double min, double max, boolean shuffle, RandomGenerator random) {
NormalDistribution dist = new NormalDistribution(random, 0.0, clusterStd, 1e-9);
double range = max - min;
Vector2D[] centerPoints = new Vector2D[centers];
for (int i = 0; i < centers; i++) {
double x = random.nextDouble() * range + min;
double y = random.nextDouble() * range + min;
centerPoints[i] = new Vector2D(x, y);
}
int[] nSamplesPerCenter = new int[centers];
int count = samples / centers;
Arrays.fill(nSamplesPerCenter, count);
for (int i = 0; i < samples % centers; i++) {
nSamplesPerCenter[i]++;
}
List<Vector2D> points = new ArrayList<Vector2D>();
for (int i = 0; i < centers; i++) {
for (int j = 0; j < nSamplesPerCenter[i]; j++) {
Vector2D point = new Vector2D(dist.sample(), dist.sample());
points.add(point.add(centerPoints[i]));
}
}
if (shuffle) {