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 typeC- the result type- Record Components:
population- the altered populationalterations- 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 Summary
ConstructorsConstructorDescriptionAltererResult(ISeq<Phenotype<G, C>> population) Create a new alter result for the given population with zero alterations.AltererResult(ISeq<Phenotype<G, C>> population, int alterations) Create a new alter result for the given arguments. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thealterationsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepopulationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AltererResult
Create a new alter result for the given arguments.- Parameters:
population- the altered populationalterations- the number of altered individuals- Throws:
NullPointerException- if the given population isnullIllegalArgumentException- if the givenalterationsis negative
-
AltererResult
Create a new alter result for the given population with zero alterations.- Parameters:
population- the altered population- Throws:
NullPointerException- if the given population isnull
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
population
Returns the value of thepopulationrecord component.- Returns:
- the value of the
populationrecord component
-
alterations
Returns the value of thealterationsrecord component.- Returns:
- the value of the
alterationsrecord component
-