protected MutatorResult<Chromosome<G>> mutate(
		final Chromosome<G> chromosome,
		final double p,
		final Random random
	) {
		final int P = probability.toInt(p);
		final ISeq<MutatorResult<G>> result = chromosome.stream()
			.map(gene -> random.nextInt() < P
				? MutatorResult.of(mutate(gene, random), 1)
				: MutatorResult.of(gene))
			.collect(ISeq.toISeq());

		return MutatorResult.of(
			chromosome.newInstance(result.map(MutatorResult::getResult)),
			result.stream().mapToInt(MutatorResult::getMutations).sum()
		);
	}
protected MutatorResult < Chromosome < G > > mutate ( final Chromosome < G > chromosome , final double p , final Random random ) { final int P = probability . toInt ( p ) ; final ISeq < MutatorResult < G > > result = chromosome . stream ( ) . map ( gene -> random . nextInt ( ) < P ? MutatorResult . of ( mutate ( gene , random ) , 1 ) : MutatorResult . of ( gene ) ) . collect ( ISeq . toISeq ( ) ) ; return MutatorResult . of ( chromosome . newInstance ( result . map ( MutatorResult :: getResult ) ) , result . stream ( ) . mapToInt ( MutatorResult :: getMutations ) . sum ( ) ) ; }
Mutates the given chromosome.

@see #mutate(Gene, Random)

@param chromosome the chromosome to mutate
@param p the mutation probability for the underlying genetic objects
@param random the random engine used for the genotype mutation
@return the mutation result