Package ec.steadystate

# Class SteadyStateEvolutionState

java.lang.Object
ec.EvolutionState
ec.steadystate.SteadyStateEvolutionState

All Implemented Interfaces:
  `Setup`, `Singleton`, `Serializable`

public class SteadyStateEvolutionState extends EvolutionState
This subclass of EvolutionState implements basic Steady-State Evolution and (in distributed form) Asynchronous Evolution. The procedure is as follows. We begin with an empty Population and one by one create new Indivdiuals and send them off to be evaluated. In basic Steady-State Evolution the individuals are immediately evaluated and we wait for them; but in Asynchronous Evolution the individuals are evaluated for however long it takes and we don't wait for them to finish. When individuals return they are added to the Population until it is full. No duplicate individuals are allowed.

At this point the system switches to its "steady state": individuals are bred from the population one by one, and sent off to be evaluated. Once again, in basic Steady-State Evolution the individuals are immediately evaluated and we wait for them; but in Asynchronous Evolution the individuals are evaluated for however long it takes and we don't wait for them to finish. When an individual returns, we mark an individual in the Population for death, then replace it with the new returning individual. Note that during the steady-state, Asynchronous Evolution could be still sending back some "new" individuals created during the initialization phase, not "bred" individuals.

The determination of how an individual is marked for death is done by the SteadyStateBreeder.

SteadyStateEvolutionState will run either for some N "generations" or for some M evaluations of individuals. A "generation" is defined as a Population's worth of evaluations. If you do not specify the number of evaluations (the M), then SteadyStateEvolutionState will use the standard generations parameter defined in EvolutionState.

Parameters

`evaluations` int >= 1 | (maximal number of evaluations to run.)
`steady.replacement-probability` 0.0 <= double <= 1.0 (default is 1.0) | (probability that an incoming individual will unilaterally replace the individual marked for death, as opposed to replacing it only if the incoming individual is superior in fitness)

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `emptyAtGenerationBoundary`
  If true, the population will be emptied after each "generation," so no replacement or breeding occurrs.
  `protected boolean`
  `firstTime`
  First time calling evolve
  `boolean`
  `generationBoundary`
  Did we just start a new generation?
  `int`
  `generationSize`
  how big is a generation? Set to the size of subpopulation 0 of the initial population.
  `static final String`
  `P_EMPTY_AT_GEN`
  `static final String`
  `P_REPLACEMENT_PROBABILITY`
  `double`
  `replacementProbability`
  When a new individual arrives, with what probability should it directly replace the existing "marked for death" individual, as opposed to only replacing it if it's superior?

  ### Fields inherited from class ec.EvolutionState

  `breeder, breedthreads, C_STARTED_FRESH, C_STARTED_FROM_CHECKPOINT, checkpoint, checkpointDirectory, checkpointModulo, checkpointPrefix, data, evalthreads, evaluations, evaluator, exchanger, finisher, generation, initializer, innovationNumber, job, numEvaluations, numGenerations, output, P_BREEDER, P_CHECKPOINT, P_CHECKPOINTDIRECTORY, P_CHECKPOINTMODULO, P_CHECKPOINTPREFIX, P_EVALUATIONS, P_EVALUATOR, P_EXCHANGER, P_FINISHER, P_GENERATIONS, P_INITIALIZER, P_INNOVATIONNUMBER, P_QUITONRUNCOMPLETE, P_STATISTICS, parameters, population, quitOnRunComplete, R_FAILURE, R_NOTDONE, R_SUCCESS, random, randomSeedOffset, runtimeArguments, statistics, UNDEFINED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SteadyStateEvolutionState()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `evolve()`
  `void`
  `finish(int result)`
  `void`
  `finishEvaluationStatistics()`
  `void`
  `setup(EvolutionState state, Parameter base)`
  Unlike for other setup() methods, ignore the base; it will always be null.
  `void`
  `startFresh()`

  ### Methods inherited from class ec.EvolutionState

  `incrementEvaluations, resetFromCheckpoint, run, startFromCheckpoint`

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

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

- ## Field Details

  - ### P_REPLACEMENT_PROBABILITY

    public static final String P_REPLACEMENT_PROBABILITY
    See Also:
      - Constant Field Values

  - ### P_EMPTY_AT_GEN

    public static final String P_EMPTY_AT_GEN
    See Also:
      - Constant Field Values

  - ### generationBoundary

    public boolean generationBoundary
    Did we just start a new generation?

  - ### generationSize

    public int generationSize
    how big is a generation? Set to the size of subpopulation 0 of the initial population.

  - ### replacementProbability

    public double replacementProbability
    When a new individual arrives, with what probability should it directly replace the existing "marked for death" individual, as opposed to only replacing it if it's superior?

  - ### emptyAtGenerationBoundary

    public boolean emptyAtGenerationBoundary
    If true, the population will be emptied after each "generation," so no replacement or breeding occurrs. This is used, for example, by Ant Colony algorithms, which have no notion of breeding.

  - ### firstTime

    protected boolean firstTime
    First time calling evolve

- ## Constructor Details

  - ### SteadyStateEvolutionState

    public SteadyStateEvolutionState()

- ## Method Details

  - ### setup

    public void setup(EvolutionState state, Parameter base)
    Description copied from class: `EvolutionState`
    Unlike for other setup() methods, ignore the base; it will always be null.
    Specified by:
      `setup` in interface `Setup`
    Overrides:
      `setup` in class `EvolutionState`
    See Also:
      - `Prototype.setup(EvolutionState,Parameter)`

  - ### startFresh

    public void startFresh()
    Overrides:
      `startFresh` in class `EvolutionState`

  - ### evolve

    public int evolve()
    Overrides:
      `evolve` in class `EvolutionState`

  - ### finishEvaluationStatistics

    public void finishEvaluationStatistics()

  - ### finish

    public void finish(int result)
    Overrides:
      `finish` in class `EvolutionState`