saealib.space.PermutationSpace#

class saealib.space.PermutationSpace(length)[source]#

Bases: object

A search space whose genomes are permutations of range(length).

Parameters:

length (int)

Methods

__init__

sample

Draw n uniformly shuffled permutations.

validate

Validate the batch type and each permutation row.

Method Details

PermutationSpace.__init__(length)[source]#
Parameters:

length (int)

Return type:

None

PermutationSpace.sample(n, rng=None)[source]#

Draw n uniformly shuffled permutations.

Parameters:
  • n (int)

  • rng (Generator | None)

Return type:

PermutationBatch

PermutationSpace.validate(genomes)[source]#

Validate the batch type and each permutation row.

Parameters:

genomes (GenomeBatch)

Return type:

ValidationResult