QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.hierarchical.HierarchicalArchive Class Reference

Route one measured genome to its coarse niche and local archive. More...

Public Member Functions

 subarchives (self)
 index (self, descriptor)
 Find the coarse niche for a descriptor vector.
 alternatives (self, descriptor)
 Return alternatives for the coarse cell containing a requested descriptor.
 coarse_descriptor (self, elite)
 Return exact coarse measurements associated with a fine elite.
 query (self, bounds)
 Filter retained elites by inclusive coarse descriptor bounds.
 add (self, genome, fitness, coarse_descriptor, fine_descriptor)
 Try to admit a measured alternative at a coarse-to-fine path.
 sample (self, rng)
 Select a branch uniformly, then sample a fine elite.

Detailed Description

Route one measured genome to its coarse niche and local archive.

Use a fixed coarse geometry and one best-only archive per occupied niche.

:param coarse: Empty best-only Grid or CVTGrid. Its descriptors locate
    a branch, and its fitness bounds and objective direction apply to
    each branch. The geometry stays empty.
:param make_fine: Callback (coarse_index) constructing a fresh empty
    best-only Grid or CVTGrid for that branch. Fine geometry and
    capacity may differ across branches. Treat returned grids as
    views when reading them through this archive.

Definition at line 19 of file hierarchical.py.

Member Function Documentation

◆ add()

qdpy.algorithms.hierarchical.HierarchicalArchive.add ( self,
genome,
fitness,
coarse_descriptor,
fine_descriptor )

Try to admit a measured alternative at a coarse-to-fine path.

Return True if the candidate fills or improves a fine cell.

Genomes are immutable and hashable. Fine archive entries store
the original genome at index zero, its measured fine features,
and the coarse descriptor used to route it.
Measurements outside either descriptor domain are skipped.

Definition at line 90 of file hierarchical.py.

◆ alternatives()

qdpy.algorithms.hierarchical.HierarchicalArchive.alternatives ( self,
descriptor )

Return alternatives for the coarse cell containing a requested descriptor.

Return the measured fine elites as a tuple, or an empty tuple for an empty branch.

Definition at line 59 of file hierarchical.py.

◆ coarse_descriptor()

qdpy.algorithms.hierarchical.HierarchicalArchive.coarse_descriptor ( self,
elite )

Return exact coarse measurements associated with a fine elite.

Return the coarse descriptor stored when this elite was measured.

Definition at line 64 of file hierarchical.py.

◆ index()

qdpy.algorithms.hierarchical.HierarchicalArchive.index ( self,
descriptor )

Find the coarse niche for a descriptor vector.

Return the coarse Grid or CVTGrid index.

Definition at line 54 of file hierarchical.py.

◆ query()

qdpy.algorithms.hierarchical.HierarchicalArchive.query ( self,
bounds )

Filter retained elites by inclusive coarse descriptor bounds.

Return alternatives matching one (lower, upper) pair per coarse axis.

Definition at line 69 of file hierarchical.py.

◆ sample()

qdpy.algorithms.hierarchical.HierarchicalArchive.sample ( self,
rng )

Select a branch uniformly, then sample a fine elite.

Return an elite using a NumPy generator.

Definition at line 116 of file hierarchical.py.

◆ subarchives()

qdpy.algorithms.hierarchical.HierarchicalArchive.subarchives ( self)
Return the occupied coarse indices and their fine archives.

Definition at line 42 of file hierarchical.py.


The documentation for this class was generated from the following file: