public static GenericClass selectClass(List<GenericClass> candidates) { double r = Randomness.nextDouble(); double d = Properties.RANK_BIAS - Math.sqrt( (Properties.RANK_BIAS * Properties.RANK_BIAS) - (4.0 * (Properties.RANK_BIAS - 1.0) * r)); int length = candidates.size(); d = d / 2.0 / (Properties.RANK_BIAS - 1.0); int index = (int) (length * d); return candidates.get(index); }