code: public double generalizedSpread(Front front, Front referenceFront) {
      int numberOfObjectives = front.getPoint(0).getDimension() ;
  
      Point[] extremeValues = new Point[numberOfObjectives] ;
      for (int i = 0; i < numberOfObjectives; i++) {
        referenceFront.sort(new PointDimensionComparator(i));
        Point newPoint = new ArrayPoint(numberOfObjectives) ;
        for (int j = 0 ; j < numberOfObjectives; j++) {
          newPoint.setValue(j,
              referenceFront.getPoint(referenceFront.getNumberOfPoints()-1).getValue(j));
        }
        extremeValues[i] = newPoint ;
      }
  
      int numberOfPoints = front.getNumberOfPoints();
  
      front.sort(new LexicographicalPointComparator());
  
      if (new EuclideanDistance().compute(front.getPoint(0),
          front.getPoint(front.getNumberOfPoints() - 1)) == 0.0) {
        return 1.0;
      } else {
        double dmean = 0.0;
  
        for (int i = 0 ; i < front.getNumberOfPoints(); i++) {
          dmean += FrontUtils.distanceToNearestPoint(front.getPoint(i), front);
        }
  
        dmean = dmean / (numberOfPoints);
  
        double dExtrems = 0.0;
        for (int i = 0 ; i < extremeValues.length; i++) {
          dExtrems += FrontUtils.distanceToClosestPoint(extremeValues[i], front);
        }
  
        double mean = 0.0;
        for (int i = 0; i < front.getNumberOfPoints(); i++) {
          mean += Math.abs(FrontUtils.distanceToNearestPoint(front.getPoint(i), front) -
              dmean);
        }
  
        return (dExtrems + mean) / (dExtrems + (numberOfPoints*dmean));
      }
    }
docs: Calculates the generalized spread metric. Given the
  pareto front, the true pareto front as <code>double []</code>
  and the number of objectives, the method return the value for the
  metric.
  @param front The front.
  @param referenceFront The reference pareto front.
  @return the value of the generalized spread metric