public class Population extends java.lang.Object implements java.lang.Cloneable, Setup
The first Population is created using the initializePopulation method of the Initializer object, which typically calls the Population's populate() method in turn. On generational systems, subsequent populations are created on a generation-by-generation basis by the Breeder object, replacing the previous Population.
In a multithreaded area of a run, Populations should be considered immutable. That is, once they are created, they should not be modified, nor anything they contain. This protocol helps ensure read-safety under multithreading race conditions.
Parameters
base.subpops int >= 1 |
(the number of subpopulations) |
base.subpop.n classname, inherits or = ec.Subpopulation |
(the class for subpopulation #n) |
base.default-subpop int >= 0 |
(the default subpopulation index. The parameter base of this subpopulation will be used as the default base for all subpopulations which do not define one themselves./tr> |
Parameter bases
base.subpop.n | Subpopulation #n. |
Modifier and Type | Field and Description |
---|---|
Parameter |
file |
boolean |
loadInds |
static java.lang.String |
NUM_SUBPOPS_PREAMBLE |
static java.lang.String |
P_DEFAULT_SUBPOP |
static java.lang.String |
P_FILE |
static java.lang.String |
P_SIZE |
static java.lang.String |
P_SUBPOP |
static java.lang.String |
SUBPOP_INDEX_PREAMBLE |
java.util.ArrayList<Subpopulation> |
subpops |
Constructor and Description |
---|
Population() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Population |
emptyClone()
Returns an instance of Population just like it had been before it was
populated with individuals.
|
void |
populate(EvolutionState state,
int thread)
Populates the population with new random individuals.
|
void |
printPopulation(EvolutionState state,
int log)
Prints an entire population in a form readable by humans but also parseable by the computer using readPopulation(EvolutionState, LineNumberReader), with a verbosity of Output.V_NO_GENERAL.
|
void |
printPopulation(EvolutionState state,
int log,
int verbosity)
Deprecated.
Verbosity no longer has meaning
|
void |
printPopulation(EvolutionState state,
java.io.PrintWriter writer)
Prints an entire population in a form readable by humans but also parseable by the computer using readPopulation(EvolutionState, LineNumberReader).
|
void |
printPopulationForHumans(EvolutionState state,
int log)
Prints an entire population in a form readable by humans, with a verbosity of Output.V_NO_GENERAL.
|
void |
printPopulationForHumans(EvolutionState state,
int log,
int verbosity)
Deprecated.
Verbosity no longer has meaning
|
void |
readPopulation(EvolutionState state,
java.io.DataInput dataInput)
Reads a population in binary form, from the format generated by writePopulation(...).
|
void |
readPopulation(EvolutionState state,
java.io.LineNumberReader reader)
Reads a population from the format generated by printPopulation(....).
|
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored
in state, built off of the parameter base base.
|
void |
writePopulation(EvolutionState state,
java.io.DataOutput dataOutput)
Writes a population in binary form, in a format readable by readPopulation(EvolutionState, DataInput).
|
public java.util.ArrayList<Subpopulation> subpops
public static final java.lang.String P_SIZE
public static final java.lang.String P_SUBPOP
public static final java.lang.String P_DEFAULT_SUBPOP
public static final java.lang.String P_FILE
public static final java.lang.String NUM_SUBPOPS_PREAMBLE
public static final java.lang.String SUBPOP_INDEX_PREAMBLE
public boolean loadInds
public Parameter file
public Population emptyClone()
public void clear()
public void setup(EvolutionState state, Parameter base)
Setup
public void populate(EvolutionState state, int thread)
public final void printPopulationForHumans(EvolutionState state, int log, int verbosity)
public final void printPopulation(EvolutionState state, int log, int verbosity)
public void printPopulationForHumans(EvolutionState state, int log)
public void printPopulation(EvolutionState state, int log)
public void printPopulation(EvolutionState state, java.io.PrintWriter writer)
public void readPopulation(EvolutionState state, java.io.LineNumberReader reader) throws java.io.IOException
java.io.IOException
public void writePopulation(EvolutionState state, java.io.DataOutput dataOutput) throws java.io.IOException
java.io.IOException
public void readPopulation(EvolutionState state, java.io.DataInput dataInput) throws java.io.IOException
java.io.IOException