Class EvolutionStart<G extends Gene<?,G>,C extends Comparable<? super C>>

java.lang.Object
io.jenetics.engine.EvolutionStart<G,C>
Type Parameters:
G - the gene type
C - the fitness type
All Implemented Interfaces:
Serializable

public final class EvolutionStart<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Serializable
Represents a state of the GA at the start of an evolution step.
Since:
3.1
Version:
6.0
See Also:
Implementation Note:
This class is immutable and thread-safe.
  • Method Details

    • population

      public ISeq<Phenotype<G,C>> population()
      Return the population before the evolution step.
      Returns:
      the start population
    • generation

      public long generation()
      Return the generation of the start population.
      Returns:
      the start generation
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static <G extends Gene<?, G>, C extends Comparable<? super C>> EvolutionStart<G,C> of(ISeq<Phenotype<G,C>> population, long generation)
      Create a new evolution start object with the given population and for the given generation.
      Type Parameters:
      G - the gene type
      C - the fitness type
      Parameters:
      population - the start population.
      generation - the start generation of the population
      Returns:
      a new evolution start object
      Throws:
      NullPointerException - if the given population is null.
      IllegalArgumentException - if the given generation is smaller then one
    • empty

      public static <G extends Gene<?, G>, C extends Comparable<? super C>> EvolutionStart<G,C> empty()
      An empty evolution start object, which can be used as initial evolution value. The evolution Engine is then responsible for creating the proper initial population,
      Type Parameters:
      G - the gene type
      C - the fitness type
      Returns:
      an empty evolution start object
      Since:
      5.1