3 * \remark This file is part of VITA.
5 * \copyright Copyright (C) 2014-2022 EOS di Manlio Morini.
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
10 * You can obtain one at http://mozilla.org/MPL/2.0/
13#if !defined(VITA_GA_SEARCH_H)
14# error "Don't include this file directly, include the specific .h instead"
17#if !defined(VITA_GA_SEARCH_TCC)
18#define VITA_GA_SEARCH_TCC
21/// Search class specialization for GAs / DE.
23template<class T, template<class> class ES, class F>
24basic_ga_search<T, ES, F>::basic_ga_search(problem &pr, F f,
29 search<T, ES>::template training_evaluator<
30 constrained_evaluator<T, ga_evaluator<T, F>, penalty_func_t<T>>>(
31 ga_evaluator<T, F>(f), pf);
33 search<T, ES>::template training_evaluator<ga_evaluator<T, F>>(f);
37/// Tries to tune search parameters for the current function.
39/// \see src_search::tune_parameters_nvi comments for further details.
41template<class T, template<class> class ES, class F>
42void basic_ga_search<T, ES, F>::tune_parameters()
44 search<T, ES>::tune_parameters();
46 if (this->prob_.env.min_individuals < 10)
47 this->prob_.env.min_individuals = 10;
49 Ensures(this->prob_.env.is_valid(true));
52#endif // include guard