Java Code Examples for org.apache.commons.math.exception.util.LocalizedFormats#POPULATION_LIMIT_NOT_POSITIVE
The following examples show how to use
org.apache.commons.math.exception.util.LocalizedFormats#POPULATION_LIMIT_NOT_POSITIVE .
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: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance. * * @param chromosomes list of chromosomes in the population * @param populationLimit maximal size of the population */ public ListPopulation (List<Chromosome> chromosomes, int populationLimit) { if (chromosomes.size() > populationLimit) { throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE, chromosomes.size(), populationLimit, false); } if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.chromosomes = chromosomes; this.populationLimit = populationLimit; }
Example 2
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance and initializes its inner * chromosome list. * * @param populationLimit maximal size of the population */ public ListPopulation (int populationLimit) { if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.populationLimit = populationLimit; this.chromosomes = new ArrayList<Chromosome>(populationLimit); }
Example 3
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance. * * @param chromosomes list of chromosomes in the population * @param populationLimit maximal size of the population */ public ListPopulation (List<Chromosome> chromosomes, int populationLimit) { if (chromosomes.size() > populationLimit) { throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE, chromosomes.size(), populationLimit, false); } if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.chromosomes = chromosomes; this.populationLimit = populationLimit; }
Example 4
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance and initializes its inner * chromosome list. * * @param populationLimit maximal size of the population */ public ListPopulation (int populationLimit) { if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.populationLimit = populationLimit; this.chromosomes = new ArrayList<Chromosome>(populationLimit); }
Example 5
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance. * * @param chromosomes list of chromosomes in the population * @param populationLimit maximal size of the population */ public ListPopulation (List<Chromosome> chromosomes, int populationLimit) { if (chromosomes.size() > populationLimit) { throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE, chromosomes.size(), populationLimit, false); } if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.chromosomes = chromosomes; this.populationLimit = populationLimit; }
Example 6
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance and initializes its inner * chromosome list. * * @param populationLimit maximal size of the population */ public ListPopulation (int populationLimit) { if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.populationLimit = populationLimit; this.chromosomes = new ArrayList<Chromosome>(populationLimit); }
Example 7
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance. * * @param chromosomes list of chromosomes in the population * @param populationLimit maximal size of the population */ public ListPopulation (List<Chromosome> chromosomes, int populationLimit) { if (chromosomes.size() > populationLimit) { throw new NumberIsTooLargeException(LocalizedFormats.LIST_OF_CHROMOSOMES_BIGGER_THAN_POPULATION_SIZE, chromosomes.size(), populationLimit, false); } if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.chromosomes = chromosomes; this.populationLimit = populationLimit; }
Example 8
Source File: ListPopulation.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a new ListPopulation instance and initializes its inner * chromosome list. * * @param populationLimit maximal size of the population */ public ListPopulation (int populationLimit) { if (populationLimit < 0) { throw new NotPositiveException(LocalizedFormats.POPULATION_LIMIT_NOT_POSITIVE, populationLimit); } this.populationLimit = populationLimit; this.chromosomes = new ArrayList<Chromosome>(populationLimit); }