Package io.jenetics

Record Class AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>>

java.lang.Object
java.lang.Record
io.jenetics.AltererResult<G,C>
Type Parameters:
G - the gene type
C - the result type
Record Components:
population - the altered population
alterations - the number of altered individuals
All Implemented Interfaces:
Serializable

public record AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>>(ISeq<Phenotype<G extends Gene<?,G>,C extends Comparable<? super C>>> population, int alterations) extends Record implements Serializable
Represents the result pair of a Alterer.alter(Seq, long) call, which consists of the altered population and the number of altered individuals.
Since:
4.0
Version:
7.0
See Also:
  • Constructor Details

    • AltererResult

      public AltererResult(ISeq<Phenotype<G,C>> population, int alterations)
      Create a new alter result for the given arguments.
      Parameters:
      population - the altered population
      alterations - the number of altered individuals
      Throws:
      NullPointerException - if the given population is null
      IllegalArgumentException - if the given alterations is negative
    • AltererResult

      public AltererResult(ISeq<Phenotype<G,C>> population)
      Create a new alter result for the given population with zero alterations.
      Parameters:
      population - the altered population
      Throws:
      NullPointerException - if the given population is null
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • population

      public ISeq<Phenotype<G,C>> population()
      Returns the value of the population record component.
      Returns:
      the value of the population record component
    • alterations

      public int alterations()
      Returns the value of the alterations record component.
      Returns:
      the value of the alterations record component