public GeneratorCluster()

in samoa-api/src/main/java/org/apache/samoa/streams/clustering/RandomRBFGeneratorEvents.java [141:176]


    public GeneratorCluster(int label) {
      boolean outofbounds = true;
      int tryCounter = 0;
      while (outofbounds && tryCounter < maxOverlapFitRuns) {
        tryCounter++;
        outofbounds = false;
        double[] center = new double[numAttsOption.getValue()];
        double radius = kernelRadiiOption.getValue() + (instanceRandom.nextBoolean() ? -1 : 1)
            * kernelRadiiRangeOption.getValue() * instanceRandom.nextDouble();
        while (radius <= 0) {
          radius = kernelRadiiOption.getValue() + (instanceRandom.nextBoolean() ? -1 : 1)
              * kernelRadiiRangeOption.getValue() * instanceRandom.nextDouble();
        }
        for (int j = 0; j < numAttsOption.getValue(); j++) {
          center[j] = instanceRandom.nextDouble();
          if (center[j] - radius < 0 || center[j] + radius > 1) {
            outofbounds = true;
            break;
          }
        }
        generator = new SphereCluster(center, radius);
      }
      if (tryCounter < maxOverlapFitRuns) {
        generator.setId(label);
        double avgWeight = 1.0 / numClusterOption.getValue();
        double weight = avgWeight + (instanceRandom.nextBoolean() ? -1 : 1) * avgWeight * densityRangeOption.getValue()
            * instanceRandom.nextDouble();
        generator.setWeight(weight);
        setDesitnation(null);
      }
      else {
        generator = null;
        kill = 0;
        System.out.println("Tried " + maxOverlapFitRuns + " times to create kernel. Reduce average radii.");
      }
    }