coreEngine.Calibration

## Class Population

- java.lang.Object
- - coreEngine.Calibration.Population

- Direct Known Subclasses:
    CAFBinPopulation, Cap2Population, ConstrCap1Pop, ConstrCap2Pop, HybridCDPPopulation, HybridPopulation, MDistCDPPopulation, MDistPopulation, PBCDPPopulation, PBPopulation

      public abstract class Population
      extends java.lang.Object

  Author:
    jltrask

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `Population.GAWorker`

  - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `Population(GeneticAlgorithm alg, Seed[] seed, int popSize)`
    `Population(GeneticAlgorithm alg, Seed[] seed, int popSize, java.util.List<Result> results)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### seed

          protected final Seed[] seed

      Seed for the algorithm instance

    - #### totalPopSize

          protected final int totalPopSize

      Total Population Size

    - #### popSizes

          protected final int[] popSizes

      Array of population sizes associated with each parallel seed

    - #### generation

          protected final Organism[] generation

      Array of organisms making up the current generation of the population

    - #### prevGen

          protected Organism[] prevGen

      Array of organisms making up the previous generation of the population

    - #### alg

          protected final GeneticAlgorithm alg

      Genetic algorithm with parameters for this population instance

    - #### topOrgs

          protected final java.util.ArrayList<Result> topOrgs

      Array of n best organisms found to this point

    - #### topBestOrg

          protected Organism topBestOrg

      Organism with the top best fitness found this far

    - #### bestFitness

          protected float bestFitness

      Fitness value of top best organism found thus far

    - #### currGenerationBestFitness

          protected float currGenerationBestFitness

      Fitness value of top best organism for current generation

    - #### numSelected

          protected int numSelected

      Value set after select method is called, indicates position to which the generation array has been filled so far

    - #### numPreserved

          protected int numPreserved

      Value set after select method is called, indicates position to which the generation array has been filled so far

    - #### generationIdx

          protected int generationIdx

      Index of the current generation held by the population data structure. Incremented each time runGeneration is called.

    - #### adjustBasisPct

          public float adjustBasisPct

    - #### minAllowRange

          protected int minAllowRange

    - #### results

          protected java.util.List<Result> results

      ArrayList of results

    - #### printSeg

          public int printSeg

    - #### queue

          private java.util.concurrent.BlockingQueue<Operator> queue

      Queue of tasks for Parallel Run

    - #### thread

          private java.lang.Thread[] thread

      Array of threads for parallel calc fitness

    - #### MAIN_AADT

          public static float MAIN_AADT

    - #### ONR_AADT

          public static float[] ONR_AADT

    - #### OFR_AADT

          public static float[] OFR_AADT

  - ### Constructor Detail

    - #### Population

          public Population(GeneticAlgorithm alg,
                            Seed[] seed,
                            int popSize)

    - #### Population

          public Population(GeneticAlgorithm alg,
                            Seed[] seed,
                            int popSize,
                            java.util.List<Result> results)

  - ### Method Detail

    - #### populate

          public abstract void populate()

    - #### applySolutionToSeed

          protected abstract Seed applySolutionToSeed()

    - #### computeRanges

          public abstract void computeRanges()

    - #### adjustSearchSpace

          public abstract void adjustSearchSpace(SearchSpace ss)

    - #### repopulateFromAdjustedSS

          public abstract void repopulateFromAdjustedSS()

    - #### getSolutionSeed

          public Seed getSolutionSeed()

    - #### getSize

          public int getSize()

    - #### setupTopOrgs

          private void setupTopOrgs()

    - #### runGeneration

          public void runGeneration()

      Runs the GA for the current generation. Evaluate -> Select -> Elite/Preserve (optional) -> Crossover -> Mutate

    - #### evaluate

          public void evaluate()

      Evaluate all organisms of the current generation.

    - #### calcAllFitnessSeq

          protected void calcAllFitnessSeq()

    - #### calcAllFitnessParallel

          protected void calcAllFitnessParallel()

    - #### startGAWorkers

          private void startGAWorkers(int n)

    - #### awaitCompletion

          private void awaitCompletion()

    - #### analyzeResults

          protected void analyzeResults()

      Analyze all organisms of the current generation. Essentially performs a batch reliability run while creating the results list.

    - #### assignAllAFs

          protected void assignAllAFs()

    - #### elitism

          protected void elitism()

    - #### preserve

          protected void preserve()

    - #### earthquake

          public abstract void earthquake()

    - #### crossover

          protected abstract void crossover()

    - #### mutate

          protected void mutate()

    - #### isOptimalToTol

          public boolean isOptimalToTol()

    - #### getBestFitness

          public float getBestFitness()

    - #### getTopBestOrganism

          public Organism getTopBestOrganism()

    - #### getCurrGenerationBestFitness

          public float getCurrGenerationBestFitness()

    - #### calcPopulationDiversity

          public void calcPopulationDiversity()

    - #### adaptParameters

          protected void adaptParameters()

    - #### repopulateFromTopOrgs

          public abstract void repopulateFromTopOrgs()

    - #### getTopOrganisms

          public java.util.ArrayList<Result> getTopOrganisms()

    - #### getSeed

          public Seed getSeed(int seedIndex)

    - #### printResults

          public void printResults()

    - #### getStartSeedBaseFitness

          public float getStartSeedBaseFitness()