public static <T> PermutationChromosome<T> of(
		final ISeq<? extends T> alleles,
		final int length
	) {
		Requires.positive(length);
		if (length > alleles.size()) {
			throw new IllegalArgumentException(format(
				"The sub-set size must be be greater then the base-set: %d > %d",
				length, alleles.size()
			));
		}

		final var rnd = RandomRegistry.random();
		final int[] subset = Subsets.next(rnd, alleles.size(), length);
		shuffle(subset, rnd);

		final ISeq<EnumGene<T>> genes = IntStream.of(subset)
			.mapToObj(i -> EnumGene.<T>of(i, alleles))
			.collect(ISeq.toISeq());

		return new PermutationChromosome<>(genes, true);
	}
Create a new, random chromosome with the given valid alleles and the
desired length.
<p>
The following example shows how to create a {@code PermutationChromosome}
for encoding a subset problem (of a fixed {@code length}).
{@snippet lang="java":
final ISeq<String> basicSet = ISeq.of("a", "b", "c", "d", "e", "f");

// The chromosome has a length of 3 and will only contain values from the
// given basic-set, with no duplicates.
final PermutationChromosome<String> ch = PermutationChromosome.of(basicSet, 3);
}

@since 3.4

@param <T> the allele type
@param alleles the base-set of the valid alleles
@param length the length of the created chromosomes
@return a new chromosome with the given valid alleles and the desired
        length
@throws IllegalArgumentException if {@code alleles.size() < length},
        {@code length <= 0} or {@code alleles.size()*length} will
        cause an integer overflow.
@throws NullPointerException if one of the arguments is {@code null}
jenetics/src/main/java/io/jenetics/PermutationChromosome.java