EvolutionResult implements Comparable<EvolutionResult<G, C>>, Serializable { @Override public int compareTo(final EvolutionResult<G, C> other) { return _optimize.compare(_best.get(), other._best.get()); } private  EvolutionResult(
		final Optimize optimize,
		final ISeq<Phenotype<G, C>> population,
		final long generation,
		final long totalGenerations,
		final EvolutionDurations durations,
		final int killCount,
		final int invalidCount,
		final int alterCount,
		final boolean dirty
	); Optimize optimize(); ISeq<Phenotype<G, C>> population(); ISeq<Genotype<G>> genotypes(); long generation(); long totalGenerations(); EvolutionDurations durations(); int killCount(); int invalidCount(); int alterCount(); Phenotype<G, C> bestPhenotype(); Phenotype<G, C> worstPhenotype(); C bestFitness(); C worstFitness(); EvolutionStart<G, C> next(); EvolutionStart<G, C> toEvolutionStart(); @Override int compareTo(final EvolutionResult<G, C> other); @Override int hashCode(); @Override boolean equals(final Object obj); static Collector<EvolutionResult<G, C>, ?, EvolutionResult<G, C>> toBestEvolutionResult(); static Collector<EvolutionResult<G, C>, ?, Phenotype<G, C>> toBestPhenotype(); static Collector<EvolutionResult<G, C>, ?, Genotype<G>> toBestGenotype(); static Collector<EvolutionResult<G, C>, ?, T> toBestResult(final Function<Genotype<G>, T> decoder); static Collector<EvolutionResult<G, C>, ?, T> toBestResult(final Codec<T, G> codec); static EvolutionInterceptor<G, C> toUniquePopulation(final Factory<Genotype<G>> factory, final int maxRetries); static EvolutionInterceptor<G, C> toUniquePopulation(final Factory<Genotype<G>> factory); static EvolutionInterceptor<G, C> toUniquePopulation(final int maxRetries); static EvolutionInterceptor<G, C> toUniquePopulation(); static EvolutionResult<G, C> of(
		final Optimize optimize,
		final ISeq<Phenotype<G, C>> population,
		final long generation,
		final long totalGenerations,
		final EvolutionDurations durations,
		final int killCount,
		final int invalidCount,
		final int alterCount
	); static EvolutionResult<G, C> of(
		final Optimize optimize,
		final ISeq<Phenotype<G, C>> population,
		final long generation,
		final EvolutionDurations durations,
		final int killCount,
		final int invalidCount,
		final int alterCount
	);  }
@Test public void compareTo() { final int length = 100; final Function<Genotype<IntegerGene>, Integer> ff = gt -> gt.gene().allele(); final MSeq<Phenotype<IntegerGene, Integer>> small = MSeq.ofLength(length); for (int i = 0; i < length; ++i) { final Genotype<IntegerGene> gt = Genotype.of(IntegerChromosome.of( IntegerGene.of(i, 0, length) )); small.set(i, Phenotype.of(gt, 1, gt.gene().intValue())); } small.shuffle(RandomRegistry.random()); final MSeq<Phenotype<IntegerGene, Integer>> big = MSeq.ofLength(length); for (int i = 0; i < length; ++i) { final Genotype<IntegerGene> gt = Genotype.of(IntegerChromosome.of( IntegerGene.of(i + length, 0, length) )); big.set(i, Phenotype.of(gt, 1, gt.gene().intValue())); } big.shuffle(RandomRegistry.random()); final EvolutionResult<IntegerGene, Integer> smallMaxResult = EvolutionResult.of( Optimize.MAXIMUM, small.toISeq(), 0, 0, EvolutionDurations.ZERO, 0, 0, 0 ); final EvolutionResult<IntegerGene, Integer> bigMaxResult = EvolutionResult.of( Optimize.MAXIMUM, big.toISeq(), 0, 0, EvolutionDurations.ZERO, 0, 0, 0 ); Assert.assertTrue(smallMaxResult.compareTo(bigMaxResult) < 0); Assert.assertTrue(bigMaxResult.compareTo(smallMaxResult) > 0); Assert.assertTrue(smallMaxResult.compareTo(smallMaxResult) == 0); Assert.assertTrue(bigMaxResult.compareTo(bigMaxResult) == 0); final EvolutionResult<IntegerGene, Integer> smallMinResult = EvolutionResult.of( Optimize.MINIMUM, small.toISeq(), 0, 0, EvolutionDurations.ZERO, 0, 0, 0 ); final EvolutionResult<IntegerGene, Integer> bigMinResult = EvolutionResult.of( Optimize.MINIMUM, big.toISeq(), 0, 0, EvolutionDurations.ZERO, 0, 0, 0 ); Assert.assertTrue(smallMinResult.compareTo(bigMinResult) > 0); Assert.assertTrue(bigMinResult.compareTo(smallMinResult) < 0); Assert.assertTrue(smallMinResult.compareTo(smallMinResult) == 0); Assert.assertTrue(bigMinResult.compareTo(bigMinResult) == 0); }