QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.windowed_map_elites.WindowedMAPElites Class Reference

Show local alternatives and restrict breeding to the selected neighborhood. More...

Inheritance diagram for qdpy.algorithms.windowed_map_elites.WindowedMAPElites:
qdpy.algorithms.constrained.ConstrainedMAPElites qdpy.algorithms.modern._FixedGeneration qdpy.algorithms.base.QDAlgorithm qdpy.algorithms.base.QDAlgorithmLike qdpy.base.Summarisable qdpy.base.Saveable qdpy.base.Copyable qdpy.base.CreatableFromConfig

Public Member Functions

 reinit (self)
 window_center (self)
 alternatives (self, count=4, *, sampling="medoids")
 Display distinct feasible elites inside the current selection window.
 focus (self, elite)
 Center the window on a live feasible elite or clear it with None.
 choose (self, chooser, count=4, *, sampling="medoids")
 Show alternatives to a chooser and recenter on its zero-based selection.
Public Member Functions inherited from qdpy.algorithms.constrained.ConstrainedMAPElites
 infeasible_elites (self)
 decode (self, candidate)
 Validate a numeric genome and translate category indices to labels.
 best (self)
Public Member Functions inherited from qdpy.algorithms.modern._FixedGeneration
 current_iter (self)
 ask (self)
 ask_batch (self, size=None)
 Issue one manual generation in proposal order.
 tell_batch (self, results)
 Apply results from the outstanding manual generation.
 optimise (self, *args, **kwargs)
Public Member Functions inherited from qdpy.algorithms.base.QDAlgorithm
Union[str, Sequence[float]] optimisation_task (self)
None optimisation_task (self, Union[str, Sequence[float]] optimisation_task)
int nb_suggestions (self)
int nb_suggestions_in_iteration (self)
int nb_evaluations (self)
int nb_evaluations_in_iteration (self)
int nb_updated (self)
int nb_updated_in_iteration (self)
int batch_size (self)
Union[int, float] nb_max_iter (self)
None tell_container_entries (self, Optional[Container] cont=None)
None add_callback (self, str event, Callable fn)
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.Saveable
Mapping[str, Any] __get_saved_state__ (self)
None save (self, str output_path, str output_type="pickle")
Public Member Functions inherited from qdpy.base.CreatableFromConfig
Any from_config (cls, Mapping[str, Any] config, **Any kwargs)

Protected Member Functions

 _start_fixed_batch (self, size)
Protected Member Functions inherited from qdpy.algorithms.constrained.ConstrainedMAPElites
 _internal_ask (self, base_ind)
 _commit_generation (self, evaluated)
Protected Member Functions inherited from qdpy.algorithms.modern._FixedGeneration
 _offer_to_grid (self, individual, cell)
 _receive_fixed_batch (self, records, verbose, batch_start_time)
Protected Member Functions inherited from qdpy.algorithms.base.QDAlgorithm
 _check_archive_weights (self)
None _attach_evaluation (self, ind, fitness, features, scores, elapsed)
Tuple[MutableMapping[str, Any], bool] _tell_before_container_update (self, IndividualLike individual)
 Read pre-admission state for optimiser feedback.
None _tell_after_container_update (self, IndividualLike individual, bool added, Mapping[str, Any] xattr={})
 Account for a completed tell and send feedback.
None _internal_tell (self, IndividualLike individual, bool added_to_container, Mapping[str, Any] xattr={})
IndividualLike _internal_best (self)
bool _verify_if_finished_iteration (self, float batch_start_time)
None _transfer_suggestion (self, IndividualLike individual, IndividualLike evaluated)
 Transfer coordinator-side metadata when evaluation returns a new object.
 _fixed_batch_plan (self, size, evaluate, packed)

Detailed Description

Show local alternatives and restrict breeding to the selected neighborhood.

User-Controlled MAP-Elites for real, integer, and categorical variables.

Initially breed across the full archive. Call ``choose()`` to display
nearby feasible elites and center the window on the chosen elite.
While focused, parents come from inside the window. Offspring may
populate any descriptor cell. When both pools have eligible parents,
alternate between feasible and infeasible elites.

:param container: Empty best-only Grid or CVTGrid with finite descriptor bounds.
:param budget: Evaluation budget for one managed optimisation call.
:param variables: Variable specifications in genome order.
:param window_radius: Positive half-width, scalar or one per archive descriptor.
:param constraint_names: Optional inequality residual names, where g(x) <= 0 is feasible.
:param seed: Private seed for parent sampling and variation.
:param batch_size: Number of proposals between archive updates.
:param real_sigma: Mutation scale as a fraction of each real variable's width.
:param optimisation_task: Native scalar objective direction or weight.

Definition at line 27 of file windowed_map_elites.py.

Member Function Documentation

◆ _start_fixed_batch()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites._start_fixed_batch ( self,
size )
protected
Prepare a generation for an optimiser that opts into batch feedback.

Reimplemented from qdpy.algorithms.modern._FixedGeneration.

Definition at line 85 of file windowed_map_elites.py.

◆ alternatives()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites.alternatives ( self,
count = 4,
* ,
sampling = "medoids" )

Display distinct feasible elites inside the current selection window.

Parameters
countMaximum number of displayed alternatives.
sampling"medoids" for PAM or "corners" for nearest-corner representatives.
Returns
Tuple of live feasible elites in display order.
Use descriptor distances scaled by window widths for display selection.

Definition at line 107 of file windowed_map_elites.py.

◆ choose()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites.choose ( self,
chooser,
count = 4,
* ,
sampling = "medoids" )

Show alternatives to a chooser and recenter on its zero-based selection.

Parameters
chooserCallable receiving the tuple of elite alternatives and returning an index.
countMaximum number of offered alternatives.
samplingProcedure used to select alternatives from the archive.
Returns
Chosen elite or None if the display is empty.
Call the chooser only when a feasible alternative is available.

Definition at line 159 of file windowed_map_elites.py.

◆ focus()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites.focus ( self,
elite )

Center the window on a live feasible elite or clear it with None.

Parameters
eliteAn elite from the current archive.
Apply a selection between completed ask/tell batches.

Definition at line 140 of file windowed_map_elites.py.

◆ reinit()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites.reinit ( self)
Reset the round-robin parent choice and clear the window.

Reimplemented from qdpy.algorithms.constrained.ConstrainedMAPElites.

Definition at line 66 of file windowed_map_elites.py.

◆ window_center()

qdpy.algorithms.windowed_map_elites.WindowedMAPElites.window_center ( self)
Return the selected descriptor or None during global search.

Definition at line 75 of file windowed_map_elites.py.


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