<commit_before>#ifndef __GENEIAL_BASE_MANAGER_H_
#define __GENEIAL_BASE_MANAGER_H_

#include <geneial/core/population/chromosome/BaseChromosome.h>
#include <geneial/core/population/Population.h>
#include <geneial/core/population/PopulationSettings.h>
#include <geneial/core/population/builder/BaseChromosomeFactory.h>

#include <cassert>

namespace geneial {
namespace population {
namespace management {

/**
 * Manages the population and most of the processes which modify the chromosomes
 */
template <typename FITNESS_TYPE>
class BaseManager
{


public:
	BaseManager<FITNESS_TYPE>(
		PopulationSettings *populationSettings,
		BaseChromosomeFactory<FITNESS_TYPE> *chromosomeFactory
		):
	_population(),
	_chromosomeFactory(chromosomeFactory),
	_populationSettings(populationSettings)
	{
		assert(_chromosomeFactory != NULL);
		assert(_populationSettings != NULL);
	}


	void replacePopulation (typename Population<FITNESS_TYPE>::chromosome_container replacementPopulation);

	/**
	 * Adds new chromosomes to the population until a limit is reached
	 */
	void replenishPopulation ();


	typename BaseChromosome<FITNESS_TYPE>::ptr getHighestFitnessChromosome() const;

	FITNESS_TYPE getHighestFitness()  const;

	typename BaseChromosome<FITNESS_TYPE>::ptr getLowestFitnessChromosome() const;

	FITNESS_TYPE getLowestFitness() const;


	Population<FITNESS_TYPE>& getPopulation()
	{
		return _population;
	}

	const BaseChromosomeFactory<FITNESS_TYPE>*& getChromosomeFactory() const
	{
		return _chromosomeFactory;
	}

	void setChromosomeFactory(
			const BaseChromosomeFactory<FITNESS_TYPE>*& chromosomeFactory)
	{
		_chromosomeFactory = chromosomeFactory;
	}

	const PopulationSettings*& getPopulationSettings() const
	{
		return _populationSettings;
	}
<commit_msg>added const getter for Population<commit_after>#ifndef __GENEIAL_BASE_MANAGER_H_
#define __GENEIAL_BASE_MANAGER_H_

#include <geneial/core/population/chromosome/BaseChromosome.h>
#include <geneial/core/population/Population.h>
#include <geneial/core/population/PopulationSettings.h>
#include <geneial/core/population/builder/BaseChromosomeFactory.h>

#include <cassert>

namespace geneial {
namespace population {
namespace management {

/**
 * Manages the population and most of the processes which modify the chromosomes
 */
template <typename FITNESS_TYPE>
class BaseManager
{


public:
	BaseManager<FITNESS_TYPE>(
		PopulationSettings *populationSettings,
		BaseChromosomeFactory<FITNESS_TYPE> *chromosomeFactory
		):
	_population(),
	_chromosomeFactory(chromosomeFactory),
	_populationSettings(populationSettings)
	{
		assert(_chromosomeFactory != NULL);
		assert(_populationSettings != NULL);
	}


	void replacePopulation (typename Population<FITNESS_TYPE>::chromosome_container replacementPopulation);

	/**
	 * Adds new chromosomes to the population until a limit is reached
	 */
	void replenishPopulation ();


	typename BaseChromosome<FITNESS_TYPE>::ptr getHighestFitnessChromosome() const;

	FITNESS_TYPE getHighestFitness()  const;

	typename BaseChromosome<FITNESS_TYPE>::ptr getLowestFitnessChromosome() const;

	FITNESS_TYPE getLowestFitness() const;


	Population<FITNESS_TYPE>& getPopulation()
	{
		return _population;
	}

	Population<FITNESS_TYPE>& getPopulation() const
	{
		return const_cast<Population<FITNESS_TYPE>&>(_population);
	}



	const BaseChromosomeFactory<FITNESS_TYPE>*& getChromosomeFactory() const
	{
		return _chromosomeFactory;
	}

	void setChromosomeFactory(
			const BaseChromosomeFactory<FITNESS_TYPE>*& chromosomeFactory)
	{
		_chromosomeFactory = chromosomeFactory;
	}

	const PopulationSettings*& getPopulationSettings() const
	{
		return _populationSettings;
	}

{'fraction_non_alphanumeric': 0.08630547236591342, 'fraction_numerical': 0.0, 'mean_word_length': 6.85042735042735, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '255604', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1100, 'n_words': 219}