code: public double calculateDistance2(DoubleSolution individual, double[] lambda) {
  
      double distance;
      double distanceSum = 0.0;
  
      double[] vecInd = new double[problem.getNumberOfObjectives()];
      double[] normalizedObj = new double[problem.getNumberOfObjectives()];
  
      for (int i = 0; i < problem.getNumberOfObjectives(); i++) {
        distanceSum += individual.getObjective(i);
      }
      for (int i = 0; i < problem.getNumberOfObjectives(); i++) {
        normalizedObj[i] = individual.getObjective(i) / distanceSum;
      }
      for (int i = 0; i < problem.getNumberOfObjectives(); i++) {
        vecInd[i] = normalizedObj[i] - lambda[i];
      }
  
      distance = norm_vector(vecInd);
  
      return distance;
    }
docs: Calculate the perpendicular distance between the solution and reference line