QDpy
Loading...
Searching...
No Matches
qdpy.containers.sliding.SlidingBoundariesGrid Class Reference

Repartition recent descriptor observations into approximately equal-mass bins. More...

Inheritance diagram for qdpy.containers.sliding.SlidingBoundariesGrid:
qdpy.containers.grids.Grid qdpy.containers.base.Container qdpy.containers.base.ContainerLike qdpy.base.Summarisable qdpy.base.Copyable qdpy.base.CreatableFromConfig

Public Member Functions

 bin_edges (self)
 remaps (self)
 discard (self, individual, also_from_parents=False)
 clear (self, also_from_parents=False)
Public Member Functions inherited from qdpy.containers.grids.Grid
ShapeLike shape (self)
int max_items_per_bin (self)
int filled_bins (self)
GridSolutionsLike solutions (self)
GridItemsPerBinLike nb_items_per_bin (self)
GridFitnessLike fitness (self)
GridFeaturesLike features (self)
GridQualityLike quality (self)
np.ndarray quality_array (self)
Optional[GridIndexLike] best_index (self)
str filled_str (self)
 index_grid (self, param)
float qd_score (self, bool normalized=True)
Public Member Functions inherited from qdpy.containers.base.Container
float capacity (self)
float free (self)
int size (self)
Any best (self)
Optional[FitnessLike] best_fitness (self)
Optional[FeaturesLike] best_features (self)
int nb_discarded (self)
int nb_added (self)
int nb_rejected (self)
int nb_operations (self)
Optional[Sequence[DomainLike]] fitness_extrema (self)
Optional[Sequence[DomainLike]] features_extrema (self)
Sequence[IndividualLike] all_parents_inds (self)
str size_str (self)
bool in_bounds (self, Any val, Any domain)
FeaturesLike get_ind_features (self, IndividualLike individual, *args, **kwargs)
FitnessLike get_ind_fitness (self, IndividualLike individual, *args, **kwargs)
 set_ind_fitness (self, IndividualLike individual, FitnessLike fitness, *args, **kwargs)
Optional[int] add (self, IndividualLike individual, bool raise_if_not_added_to_parents=False)
int update (self, Iterable iterable, bool ignore_exceptions=True, bool issue_warning=False)
None clear_all (self)
 novelty (self, IndividualLike individual, **kwargs)
 novelty_local_competition (self, IndividualLike individual, **kwargs)
Any to_grid (self, Union[ShapeLike, int] shape, int max_items_per_bin=1, Optional[float] capacity=None, **Any kwargs)
Public Member Functions inherited from qdpy.base.Summarisable
Mapping[str, Any] __get_summary_state__ (self)
str summary (self, Optional[int] max_depth=None, Optional[int] max_entry_length=250)
Public Member Functions inherited from qdpy.base.CreatableFromConfig
Any from_config (cls, Mapping[str, Any] config, **Any kwargs)

Protected Member Functions

 _index_grid_features (self, features)
 _check_if_can_be_added (self, individual)
 _add_internal (self, individual, raise_if_not_added_to_parents, only_to_parents)
 Choose a cell and apply its admission policy.
Protected Member Functions inherited from qdpy.containers.grids.Grid
None _init_grid (self)
Generator[GridIndexLike, None, None] _index_grid_iterator (self)
None _update_quality (self, GridIndexLike ig)
Optional[int] _add_to_grid (self, IndividualLike individual, GridIndexLike ig, bool raise_if_not_added_to_parents, Optional[int] replacement=None)
 Apply a successful storage update to per-cell bookkeeping.
GridIndexLike _stored_cell (self, IndividualLike individual)
 Find the admitted cell by object identity.
Protected Member Functions inherited from qdpy.containers.base.Container
Optional[Sequence[DomainLike]] _float_feature_extrema (self)
Tuple[bool, int] _add_to_collection (self, BackendLike[IndividualLike] collection, IndividualLike individual)
None _add_to_parents (self, IndividualLike individual, bool require_admission)
 Forward a candidate to each immediate parent in order.
 _can_undo_parent_appends (self, individual)
 _add_to_append_only_parents (self, individual)
 Take a short pre-admission record and rebuild a snapshot only after rejection.
 _snapshot_parents (self)
None _discard_by_index (self, IndividualLike individual, Optional[int] idx=None, bool also_from_parents=False)

Detailed Description

Repartition recent descriptor observations into approximately equal-mass bins.

Best-only MAP-Elites grid with periodically updated internal bin edges.

Valid offers enter the bounded FIFO even when they lose local competition.
A remap recomputes descriptor quantiles and replays old elites and the
buffer with the new bin edges. Finite declared outer bounds stay fixed.
Tied quantiles can leave zero-width cells. Treat offered objects as
immutable while the grid can still replay them.

:param remap_frequency: Number of valid offers between remaps.
:param buffer_capacity: Maximum number of recent offers retained for remapping.
:param kwargs: Native Grid shape, descriptor and objective settings.
    This grid uses one elite per bin and owns its storage.

Definition at line 26 of file sliding.py.

Member Function Documentation

◆ _add_internal()

qdpy.containers.sliding.SlidingBoundariesGrid._add_internal ( self,
individual,
raise_if_not_added_to_parents,
only_to_parents )
protected

Choose a cell and apply its admission policy.

Parameters
individualCandidate with validated local measurements.
raise_if_not_added_to_parentsWhether parent errors must propagate.
only_to_parentsBypass cell admission.
Returns
A storage index for locally admitted or existing entries.

Reimplemented from qdpy.containers.grids.Grid.

Definition at line 112 of file sliding.py.

◆ _check_if_can_be_added()

qdpy.containers.sliding.SlidingBoundariesGrid._check_if_can_be_added ( self,
individual )
protected
Validate the resolved objective and descriptor vectors.

Reject invalid fitness and vectors outside declared coordinate
bounds. This step runs before storage or parent forwarding.

Reimplemented from qdpy.containers.base.Container.

Definition at line 76 of file sliding.py.

◆ _index_grid_features()

qdpy.containers.sliding.SlidingBoundariesGrid._index_grid_features ( self,
features )
protected
Get the index in the grid of a given individual with features ``features``, raising an IndexError if it is outside the grid. 

Reimplemented from qdpy.containers.grids.Grid.

Definition at line 71 of file sliding.py.

◆ bin_edges()

qdpy.containers.sliding.SlidingBoundariesGrid.bin_edges ( self)
Return one immutable sequence of physical edges per axis.

Definition at line 62 of file sliding.py.

◆ clear()

qdpy.containers.sliding.SlidingBoundariesGrid.clear ( self,
also_from_parents = False )
Clear candidates and restore the initial uniform geometry.

Reimplemented from qdpy.containers.base.Container.

Definition at line 132 of file sliding.py.

◆ discard()

qdpy.containers.sliding.SlidingBoundariesGrid.discard ( self,
individual,
also_from_parents = False )
Remove a candidate from the live grid and the remapping buffer.

Reimplemented from qdpy.containers.grids.Grid.

Definition at line 126 of file sliding.py.

◆ remaps()

qdpy.containers.sliding.SlidingBoundariesGrid.remaps ( self)
Return the number of committed boundary rebuilds.

Definition at line 67 of file sliding.py.


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