int best_range = RANGE_ALL;  for (this.range = RANGE_SHORT; this.range <= RANGE_LONG; this.range++){ if (optimizer[this.range] > optimizer[best_range]){ best_range = this.range; } } this.range = best_range;
    private void computeRange() {        Arrays.fill(range_damages, 0);        for (int base = 0; base < 3; base++) {            for (int i = 1 + 6 * base; i < 8 + 6 * base; i++) {                range_damages[base] += this.damages[ToHitData.SIDE_FRONT][i];            }            range_damages[base] /= 8;            range_damages[3] += range_damages[base];        }        range_damages[3] /= 3;        if (range_damages[0] > 2.5 * range_damages[1]) {            this.range = RANGE_SHORT;        } else if (range_damages[1] > 2.5 * range_damages[2]) {            this.range = RANGE_MEDIUM;        } else if (range_damages[2] > .25 * range_damages[0]) {            this.range = RANGE_LONG;        } else {            this.range = RANGE_ALL;        }    }