public abstract class Population
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
Population.GAWorker |
| Modifier and Type | Field and Description |
|---|---|
float |
adjustBasisPct |
protected GeneticAlgorithm |
alg
Genetic algorithm with parameters for this population instance
|
protected float |
bestFitness
Fitness value of top best organism found thus far
|
protected float |
currGenerationBestFitness
Fitness value of top best organism for current generation
|
protected Organism[] |
generation
Array of organisms making up the current generation of the population
|
protected int |
generationIdx
Index of the current generation held by the population data structure.
|
static float |
MAIN_AADT |
protected int |
minAllowRange |
protected int |
numPreserved
Value set after select method is called, indicates position to which the
generation array has been filled so far
|
protected int |
numSelected
Value set after select method is called, indicates position to which the
generation array has been filled so far
|
static float[] |
OFR_AADT |
static float[] |
ONR_AADT |
protected int[] |
popSizes
Array of population sizes associated with each parallel seed
|
protected Organism[] |
prevGen
Array of organisms making up the previous generation of the population
|
int |
printSeg |
private java.util.concurrent.BlockingQueue<Operator> |
queue
Queue of tasks for Parallel Run
|
protected java.util.List<Result> |
results
ArrayList of results
|
protected Seed[] |
seed
Seed for the algorithm instance
|
private java.lang.Thread[] |
thread
Array of threads for parallel calc fitness
|
protected Organism |
topBestOrg
Organism with the top best fitness found this far
|
protected java.util.ArrayList<Result> |
topOrgs
Array of n best organisms found to this point
|
protected int |
totalPopSize
Total Population Size
|
| Constructor and Description |
|---|
Population(GeneticAlgorithm alg,
Seed[] seed,
int popSize) |
Population(GeneticAlgorithm alg,
Seed[] seed,
int popSize,
java.util.List<Result> results) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adaptParameters() |
abstract void |
adjustSearchSpace(SearchSpace ss) |
protected void |
analyzeResults()
Analyze all organisms of the current generation.
|
protected abstract Seed |
applySolutionToSeed() |
protected void |
assignAllAFs() |
private void |
awaitCompletion() |
protected void |
calcAllFitnessParallel() |
protected void |
calcAllFitnessSeq() |
void |
calcPopulationDiversity() |
abstract void |
computeRanges() |
protected abstract void |
crossover() |
abstract void |
earthquake() |
protected void |
elitism() |
void |
evaluate()
Evaluate all organisms of the current generation.
|
float |
getBestFitness() |
float |
getCurrGenerationBestFitness() |
Seed |
getSeed(int seedIndex) |
int |
getSize() |
Seed |
getSolutionSeed() |
float |
getStartSeedBaseFitness() |
Organism |
getTopBestOrganism() |
java.util.ArrayList<Result> |
getTopOrganisms() |
boolean |
isOptimalToTol() |
protected void |
mutate() |
abstract void |
populate() |
protected void |
preserve() |
void |
printResults() |
abstract void |
repopulateFromAdjustedSS() |
abstract void |
repopulateFromTopOrgs() |
void |
runGeneration()
Runs the GA for the current generation.
|
private void |
setupTopOrgs() |
private void |
startGAWorkers(int n) |
protected final Seed[] seed
protected final int totalPopSize
protected final int[] popSizes
protected final Organism[] generation
protected Organism[] prevGen
protected final GeneticAlgorithm alg
protected final java.util.ArrayList<Result> topOrgs
protected Organism topBestOrg
protected float bestFitness
protected float currGenerationBestFitness
protected int numSelected
protected int numPreserved
protected int generationIdx
public float adjustBasisPct
protected int minAllowRange
protected java.util.List<Result> results
public int printSeg
private java.util.concurrent.BlockingQueue<Operator> queue
private java.lang.Thread[] thread
public static float MAIN_AADT
public static float[] ONR_AADT
public static float[] OFR_AADT
public Population(GeneticAlgorithm alg, Seed[] seed, int popSize)
public Population(GeneticAlgorithm alg, Seed[] seed, int popSize, java.util.List<Result> results)
public abstract void populate()
protected abstract Seed applySolutionToSeed()
public abstract void computeRanges()
public abstract void adjustSearchSpace(SearchSpace ss)
public abstract void repopulateFromAdjustedSS()
public Seed getSolutionSeed()
public int getSize()
private void setupTopOrgs()
public void runGeneration()
public void evaluate()
protected void calcAllFitnessSeq()
protected void calcAllFitnessParallel()
private void startGAWorkers(int n)
private void awaitCompletion()
protected void analyzeResults()
protected void assignAllAFs()
protected void elitism()
protected void preserve()
public abstract void earthquake()
protected abstract void crossover()
protected void mutate()
public boolean isOptimalToTol()
public float getBestFitness()
public Organism getTopBestOrganism()
public float getCurrGenerationBestFitness()
public void calcPopulationDiversity()
protected void adaptParameters()
public abstract void repopulateFromTopOrgs()
public java.util.ArrayList<Result> getTopOrganisms()
public Seed getSeed(int seedIndex)
public void printResults()
public float getStartSeedBaseFitness()