public class Population extends java.lang.Object implements java.lang.Iterable<Individual>
Individual
Constructor and Description |
---|
Population(java.lang.String inputFileName)
Creates a new and empty population instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Individual individual)
Add an individual to this population.
|
void |
addAll(java.util.Collection<? extends Individual> individuals)
Add a collection of individuals to this population.
|
java.lang.String |
getFullIndividualFileName(java.lang.String path,
java.lang.String idxPrefix)
Get the full name of the target file.
|
java.lang.String |
getInputFileName()
Get name of the original file.
|
java.util.Iterator<Individual> |
iterator() |
int |
size()
Get the number of individuals in the population.
|
void |
store(java.lang.String path)
Writes the population to the file system.
|
public Population(java.lang.String inputFileName)
inputFileName
- name of the original file from which all individuals
in this population are derivedpublic java.lang.String getInputFileName()
public void add(Individual individual)
individual
- to addjava.lang.NullPointerException
- if individual is nullpublic void addAll(java.util.Collection<? extends Individual> individuals)
individuals
- to addjava.lang.NullPointerException
- if individuals is nullpublic java.util.Iterator<Individual> iterator()
iterator
in interface java.lang.Iterable<Individual>
public int size()
public java.lang.String getFullIndividualFileName(java.lang.String path, java.lang.String idxPrefix)
path
- Path with placeholders to the target files. See the
-outputPath parameter. This string must
contain the %idx placeholder. If it does not contain it, the
placeholder is added at the end of the file nameidxPrefix
- index prefix of the current individualpublic void store(java.lang.String path)
path
- Path with placeholders to the target files. See the
-outputPath parameter