private void calculateRanges(Population population){
  if (population.size() < 2) {
    throw new IllegalArgumentException("requires at least two solutions");
  }
  for (int i=0; i < problem.getNumberOfObjectives(); i++) {
    minimum[i]=Double.POSITIVE_INFINITY;
    maximum[i]=Double.NEGATIVE_INFINITY;
  }
  for (int i=0; i < population.size(); i++) {
    Solution solution=population.get(i);
    if (solution.violatesConstraints()) {
      continue;
    }
    for (int j=0; j < problem.getNumberOfObjectives(); j++) {
      minimum[j]=Math.min(minimum[j],solution.getObjective(j));
      maximum[j]=Math.max(maximum[j],solution.getObjective(j));
    }
  }
}

private void calculateRanges ( Population population ) { if ( population . size ( ) < 2 ) { throw new IllegalArgumentException ( "requires at least two solutions" ) ; } for ( int i = 0 ; i < problem . getNumberOfObjectives ( ) ; i ++ ) { minimum [ i ] = Double . POSITIVE_INFINITY ; maximum [ i ] = Double . NEGATIVE_INFINITY ; } for ( int i = 0 ; i < population . size ( ) ; i ++ ) { Solution solution = population . get ( i ) ; if ( solution . violatesConstraints ( ) ) { continue ; } for ( int j = 0 ; j < problem . getNumberOfObjectives ( ) ; j ++ ) { minimum [ j ] = Math . min ( minimum [ j ] , solution . getObjective ( j ) ) ; maximum [ j ] = Math . max ( maximum [ j ] , solution . getObjective ( j ) ) ; } } }
calculates the range of each objective given the population . the range is defined by the minimum and maximum value of each objective .
