Example usage for org.apache.commons.math3.exception.util LocalizedFormats ELITISM_RATE

List of usage examples for org.apache.commons.math3.exception.util LocalizedFormats ELITISM_RATE

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception.util LocalizedFormats ELITISM_RATE.

Prototype

LocalizedFormats ELITISM_RATE

To view the source code for org.apache.commons.math3.exception.util LocalizedFormats ELITISM_RATE.

Click Source Link

Usage

From source file:org.apache.kylin.cube.cuboid.algorithm.generic.lib.ElitisticListPopulation.java

/**
 * Sets the elitism rate, i.e. how many best chromosomes will be directly transferred to the next generation [in %].
 *
 * @param elitismRate how many best chromosomes will be directly transferred to the next generation [in %]
 * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range
 *///from w w w  .  ja  va 2  s.  c om
public void setElitismRate(final double elitismRate) throws OutOfRangeException {
    if (elitismRate < 0 || elitismRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.ELITISM_RATE, elitismRate, 0, 1);
    }
    this.elitismRate = elitismRate;
}