moptipy.mo.archive package

Routines and tools for dealing with multi-objective archives.

Submodules

moptipy.mo.archive.keep_farthest module

A multi-objective archive pruner based on distance.

class moptipy.mo.archive.keep_farthest.KeepFarthest(problem, keep_best_of_dimension=None)[source]

Bases: MOArchivePruner

Keep the best records of selected dimensions and those farthest from them.

This archive pruner proceeds in two steps:

First, it keeps the records that minimize a user-provided set of dimensions.

Second, it iteratively adds the records to the selection which have the maximum minimal distance to the already selected ones in terms of the square distance over the normalized dimensions.

This should provide some sort of diversity in the archive while allowing the user to preserve optima in certain dimensions.

prune(archive, n_keep, size)[source]

Preserve the best of certain dimensions and keep the rest diverse.

Parameters:
  • archive (list[MORecord]) – the archive, i.e., a list of tuples of solutions and their objective vectors

  • n_keep (int) – the number of solutions to keep

  • size (int) – the current size of the archive

Return type:

None