code: public void evaluate(DoubleSolution solution) {
      float[] variables = new float[getNumberOfVariables()];
      double[] x = new double[getNumberOfVariables()];
  
      for (int i = 0; i < getNumberOfVariables(); i++) {
        x[i] = solution.getVariableValue(i);
      }
  
      for (int i = 0; i < getNumberOfVariables(); i++) {
        variables[i] = (float) x[i] ;
      }
  
      float[] sol2 = evaluate(variables);
  
      for (int i = 0; i < sol2.length; i++) {
        solution.setObjective(i, sol2[i]);
      }
    }
docs: Evaluates a solution
  
  @param solution The solution to runAlgorithm
  @throws org.uma.jmetal.util.JMetalException