private void prepareWheel() {
    double effMin = 0;
    double range = 0;

    if (!flag(OPT_MINIMIZE)) {
      effMin = meanValue - stdDeviation * 2;
      range = maxValue - effMin;
      wheelBaseValue = effMin;
      if (range < 0.001)
        wheelBaseValue = effMin - 20.0;
    }
    else {
      effMin = (meanValue + stdDeviation * 2);
      range = effMin - minValue;
      wheelBaseValue = effMin;
      if (range < 0.001)
        wheelBaseValue = effMin + 20.0;
    }

    wheelTotalValue = 0;
    for (int i = 0; i < popSize; i++) {
      double v = g(i).getValue();
      if (!flag(OPT_MINIMIZE)) {
        if (v >= wheelBaseValue)
          wheelTotalValue += (v - wheelBaseValue);
      }
      else {
        if (v <= wheelBaseValue)
          wheelTotalValue += (wheelBaseValue - v);
      }

    }
//    wheelTotalValue = totalValue - (wheelBaseValue * popSize);

    if (d) {
      System.out.println("totalValue=" + totalValue + ", wheelBase=" +
                         wheelBaseValue + ", wheelTotal=" + wheelTotalValue);
      int i;
      double d = 0;
      for (i = 0; i < popSize; i++) {
        double v = g(i).getValue();
        d += (v - wheelBaseValue);
        System.out.println("i=" + i + ", d=" + Fmt.f(d));
      }
      System.out.println("wheelTotalValue=" + Fmt.f(wheelTotalValue));
    }
  }