Package io.jenetics
Class AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>>
- java.lang.Object
-
- io.jenetics.AltererResult<G,C>
-
- All Implemented Interfaces:
Serializable
public final class AltererResult<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Serializable
Represents the result pair of aAlterer.alter(Seq, long)
call, which consists of the altered population and the number of altered individuals.- Since:
- 4.0
- Version:
- 6.0
- See Also:
Alterer
, Serialized Form- Implementation Requirements:
- This class is immutable and thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
alterations()
Return the number of altered individuals.boolean
equals(Object obj)
int
hashCode()
static <G extends Gene<?,G>,C extends Comparable<? super C>>
AltererResult<G,C>of(Seq<Phenotype<G,C>> population)
Return a new alter result for the given arguments.static <G extends Gene<?,G>,C extends Comparable<? super C>>
AltererResult<G,C>of(Seq<Phenotype<G,C>> population, int alterations)
Return a new alter result for the given arguments.ISeq<Phenotype<G,C>>
population()
Return the altered population.String
toString()
-
-
-
Method Detail
-
population
public ISeq<Phenotype<G,C>> population()
Return the altered population.- Returns:
- the altered population
-
alterations
public int alterations()
Return the number of altered individuals.- Returns:
- the number of altered individuals
-
of
public static <G extends Gene<?,G>,C extends Comparable<? super C>> AltererResult<G,C> of(Seq<Phenotype<G,C>> population, int alterations)
Return a new alter result for the given arguments.- Type Parameters:
G
- the gene typeC
- the result type- Parameters:
population
- the altered populationalterations
- the number of altered individuals- Returns:
- a new alterer for the given arguments
- Throws:
NullPointerException
- if the given population isnull
IllegalArgumentException
- if the givenalterations
is negative
-
of
public static <G extends Gene<?,G>,C extends Comparable<? super C>> AltererResult<G,C> of(Seq<Phenotype<G,C>> population)
Return a new alter result for the given arguments.- Type Parameters:
G
- the gene typeC
- the result type- Parameters:
population
- the altered population- Returns:
- a new alterer for the given arguments
- Throws:
NullPointerException
- if the given population isnull
-
-