saealib.space.ObjectSpace#

class saealib.space.ObjectSpace(representation)[source]#

Bases: object

A search space for arbitrary Python objects.

An ObjectSpace registers no services by default. It can be sampled, selected, and concatenated; components requiring richer operations will be rejected at compile time due to missing services.

Parameters:

representation (RepresentationSpec)

Methods

__init__

sample

Sample n empty object slots (represented by None placeholders).

validate

Check if genomes batch is an ObjectBatch.

Method Details

ObjectSpace.__init__(representation)[source]#
Parameters:

representation (RepresentationSpec)

Return type:

None

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

Sample n empty object slots (represented by None placeholders).

Parameters:
  • n (int)

  • rng (Generator | None)

Return type:

ObjectBatch

ObjectSpace.validate(genomes)[source]#

Check if genomes batch is an ObjectBatch.

Parameters:

genomes (GenomeBatch)

Return type:

ValidationResult