private void printData(Problem problem,boolean reduced,Population population,PrintWriter writer){
  int numberOfVariables=problem.getNumberOfVariables();
  int numberOfObjectives=problem.getNumberOfObjectives();
  if (reduced) {
    numberOfVariables=0;
  }
  for (  Solution solution : population) {
    for (int i=0; i < numberOfVariables; i++) {
      if (i > 0) {
        writer.print(",");
      }
      if (solution.getVariable(i) instanceof RealVariable) {
        writer.print(EncodingUtils.getReal(solution.getVariable(i)));
      }
 else {
        writer.print("?");
      }
    }
    for (int i=0; i < numberOfObjectives; i++) {
      if ((i > 0) || (numberOfVariables > 0)) {
        writer.print(",");
      }
      writer.print(solution.getObjective(i));
    }
    writer.println();
  }
}

private void printData ( Problem problem , boolean reduced , Population population , PrintWriter writer ) { int numberOfVariables = problem . getNumberOfVariables ( ) ; int numberOfObjectives = problem . getNumberOfObjectives ( ) ; if ( reduced ) { numberOfVariables = 0 ; } for ( Solution solution : population ) { for ( int i = 0 ; i < numberOfVariables ; i ++ ) { if ( i > 0 ) { writer . print ( "," ) ; } if ( solution . getVariable ( i ) instanceof RealVariable ) { writer . print ( EncodingUtils . getReal ( solution . getVariable ( i ) ) ) ; } else { writer . print ( "?" ) ; } } for ( int i = 0 ; i < numberOfObjectives ; i ++ ) { if ( ( i > 0 ) || ( numberOfVariables > 0 ) ) { writer . print ( "," ) ; } writer . print ( solution . getObjective ( i ) ) ; } writer . println ( ) ; } }
prints the given population as the arff data section .
