code: public static <S extends Solution<?>> void weightedSum(List<S> solutionsList, double[] weights) {
      for (S solution : solutionsList) {
        double sum = weights[0] * solution.getObjective(0);
        for (int i = 1; i < solution.getNumberOfObjectives(); i++) {
          sum += weights[i] * solution.getObjective(i);
        }
        setScalarizationValue(solution, sum);
      }
  
    }
docs: Objective values are multiplied by weights and summed. Weights should
  always be positive.
  
  @param solutionsList A list of solutions.
  @param weights       Positive constants by which objectives are summed.