• Grigorii's avatar
    Refactor improvement checking and adaptive population size in GP Optimisers (#662) · 135b9c5d
    Grigorii authored
    
    Primary changes:
    - Introduce GenerationKeeper:
      It encapsulates watching improvements/stagnation and keeping best individuals through generations
    - Drop usages of supplementary metrics in optimisers:
      In favor of using compound SingleObjFitness with supplementary metrics.
    - Encapsulate dynamic parameter of next offspring size in AdaptiveParameter.
      This simplifies main optimiser loop a lot, allowing to drop many variables with duplicate functionality,
      thanks to combination of GenerationKeeper and Fitness. See AdaptivePopulationSize class.
    - Other minor code refactorings (notably dropping custom ParetoFront)
    
    Important notes on changes in API:
    - Now if only 1 metric is provided, additional default complexity metric is appended to metrics
      The appended metric is the previously used and scattered in Optimisers supplementary metric,
      which is used for distinguishing individuals with equal fitness.
      See usages of ComposerBuilder._default_complexity_metrics()
    
    This PR is a part of big refactoring #608
    135b9c5d
test_history.py 7.93 KB