Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches
search_monte_carlo_threaded.hpp
Go to the documentation of this file.
1#ifndef FSTSEARCHMONTECARLOTHREADED_H
2#define FSTSEARCHMONTECARLOTHREADED_H
3 /*
21=========================================================================
22Copyright and license:
23 * FST4 software (with the exception of any bundled or externally linked
24 third-party components) is Copyright (C) 2000-present Institute of
25 Information Theory and Automation of the Czech Academy of Sciences (UTIA).
26 * FST4 is free software: you can redistribute it and/or modify it under
27 the terms of the GNU Affero General Public License as published by the
28 Free Software Foundation, version 3. The full text of the license is in
29 the file LICENSE in the distribution root and at
30 https://www.gnu.org/licenses/agpl-3.0.html.
31 * FST4 is distributed in the hope that it will be useful, but WITHOUT ANY
32 WARRANTY; without even the implied warranty of MERCHANTABILITY or
33 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
34 License for more details.
35 * Closed-source use without the AGPL's copyleft obligations requires a
36 commercial license from UTIA; in case of interest write to
37 utia@utia.cas.cz. LICENSING.md in the distribution root explains both
38 options, the contributor license agreement that every contribution
39 requires, and the contacts (technical questions and pull requests:
40 somol@utia.cas.cz, with "FST" in the subject line).
41========================================================================== */
42
43#include <cassert>
44#include "error.hpp"
45#include "global.hpp"
48
49namespace FST {
50
66template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
67class Search_Monte_Carlo_Threaded : public Search_Monte_Carlo<RETURNTYPE,DIMTYPE,SUBSET,CRITERION>{
68public:
76 explicit Search_Monte_Carlo_Threaded(const unsigned int max_threads=2, const unsigned long trials_limit=1000, const unsigned long time_limit=0, const unsigned int time_limit_check_freq=10)
77 :Search_Monte_Carlo<RETURNTYPE,DIMTYPE,SUBSET,CRITERION>(trials_limit,time_limit,time_limit_check_freq,PEvaluatorEngine(new Candidate_Evaluator_Threaded<RETURNTYPE,DIMTYPE,SUBSET,CRITERION>(max_threads)))
78 {assert(max_threads>0); notify("Search_Monte_Carlo_Threaded constructor.");}
79 virtual ~Search_Monte_Carlo_Threaded() {notify("Search_Monte_Carlo_Threaded destructor.");}
80};
81
82} // namespace
83#endif // FSTSEARCHMONTECARLOTHREADED_H ///:~
Implements concurrent evaluation of a criterion on a set of subset candidates.
Implements concurrent evaluation of a criterion on a set of subset candidates.
Definition candidate_evaluator_threaded.hpp:156
DEPRECATED shim: threaded version of randomized search that repeatedly samples random subsets.
Definition search_monte_carlo_threaded.hpp:67
Search_Monte_Carlo< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > parent
base class: the merged Monte Carlo search this shim configures with a threaded engine
Definition search_monte_carlo_threaded.hpp:69
parent::PEvaluatorEngine PEvaluatorEngine
the candidate-evaluation engine type, inherited from parent
Definition search_monte_carlo_threaded.hpp:70
Search_Monte_Carlo_Threaded(const unsigned int max_threads=2, const unsigned long trials_limit=1000, const unsigned long time_limit=0, const unsigned int time_limit_check_freq=10)
Constructs a Search_Monte_Carlo configured with a Candidate_Evaluator_Threaded engine of max_threads ...
Definition search_monte_carlo_threaded.hpp:76
Search_Monte_Carlo(const unsigned long long trials_limit=1000, const unsigned long time_limit=0, const unsigned int time_limit_check_freq=1, PEvaluatorEngine engine=PEvaluatorEngine())
engine defaults to sequential in-line evaluation if not supplied; see set_stopping_condition() for tr...
Definition search_monte_carlo.hpp:120
std::shared_ptr< EVALUATORENGINE > PEvaluatorEngine
Definition search_monte_carlo.hpp:118
FST4 specific error passing class.
Global definitions.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition global.hpp:112
Repeatedly samples random subsets to eventually yield the one with highest criterion value.
Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.