Java Code Examples for org.apache.commons.math3.exception.util.LocalizedFormats#MUTATION_RATE

The following examples show how to use org.apache.commons.math3.exception.util.LocalizedFormats#MUTATION_RATE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 2
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 3
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 4
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 5
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 6
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 7
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}
 
Example 8
Source File: GeneticAlgorithm.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new genetic algorithm.
 * @param crossoverPolicy The {@link CrossoverPolicy}
 * @param crossoverRate The crossover rate as a percentage (0-1 inclusive)
 * @param mutationPolicy The {@link MutationPolicy}
 * @param mutationRate The mutation rate as a percentage (0-1 inclusive)
 * @param selectionPolicy The {@link SelectionPolicy}
 * @throws OutOfRangeException if the crossover or mutation rate is outside the [0, 1] range
 */
public GeneticAlgorithm(final CrossoverPolicy crossoverPolicy,
                        final double crossoverRate,
                        final MutationPolicy mutationPolicy,
                        final double mutationRate,
                        final SelectionPolicy selectionPolicy) throws OutOfRangeException {

    if (crossoverRate < 0 || crossoverRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE,
                                      crossoverRate, 0, 1);
    }
    if (mutationRate < 0 || mutationRate > 1) {
        throw new OutOfRangeException(LocalizedFormats.MUTATION_RATE,
                                      mutationRate, 0, 1);
    }
    this.crossoverPolicy = crossoverPolicy;
    this.crossoverRate = crossoverRate;
    this.mutationPolicy = mutationPolicy;
    this.mutationRate = mutationRate;
    this.selectionPolicy = selectionPolicy;
}