code: public static double distanceBetweenSolutionsInObjectiveSpace(DoubleSolution solutionI, DoubleSolution solutionJ) {
      double distance = 0.0;
  
      double diff;
      for (int i = 0; i < solutionI.getNumberOfVariables(); i++) {
        diff = solutionI.getVariableValue(i) - solutionJ.getVariableValue(i);
        distance += Math.pow(diff, 2.0);
      }
  
      return Math.sqrt(distance);
    }
docs: Returns the distance between two solutions in the search space.
  
  @param solutionI The first <code>Solution</code>.
  @param solutionJ The second <code>Solution</code>.
  @return the distance between solutions.