DEPRECATED shim: threaded version of sequential selection step in sequential search type of methods.
More...
|
|
typedef Sequential_Step_Straight< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | parent |
| | base class: the merged sequential-step implementation this shim configures with a threaded engine
|
| typedef parent::PEvaluatorEngine | PEvaluatorEngine |
|
typedef Sequential_Step< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | parent |
| | base class alias
|
|
typedef std::shared_ptr< CRITERION > | PCriterion |
| | shared pointer to the criterion the search optimizes
|
|
typedef std::shared_ptr< SUBSET > | PSubset |
| | shared pointer to a feature subset
|
|
typedef Candidate_Evaluator< RETURNTYPE, DIMTYPE, SUBSET, CRITERION > | EVALUATORENGINE |
| | the injected evaluation-strategy interface (sequential in-line or thread-pooled)
|
| typedef std::shared_ptr< EVALUATORENGINE > | PEvaluatorEngine |
|
typedef std::shared_ptr< CRITERION > | PCriterion |
| | shared pointer to the criterion this step evaluates candidates against
|
|
typedef std::shared_ptr< SUBSET > | PSubset |
| | shared pointer to a feature subset
|
|
typedef std::shared_ptr< Result_Tracker< RETURNTYPE, SUBSET > > | PResultTracker |
| | shared pointer to the result tracker enabled via enable_result_tracking()
|
|
| | Sequential_Step_Straight_Threaded (const unsigned int max_threads=2) |
| | Constructs a Sequential_Step_Straight configured with a Candidate_Evaluator_Threaded engine of max_threads workers.
|
|
| Sequential_Step_Straight (PEvaluatorEngine engine=PEvaluatorEngine()) |
| | engine defaults to sequential in-line evaluation (Candidate_Evaluator_Sequential) if not supplied; pass a Candidate_Evaluator_Threaded to have the candidates evaluated in a thread pool
|
| bool | evaluate_candidates (RETURNTYPE &result, const PSubset sub, const PCriterion crit, const DIMTYPE _generalization_level=1, std::ostream &os=std::cout) override |
| | evaluates every subset offered by sub->get*CandidateSubset() and leaves the highest-valued one in sub (see Sequential_Step::evaluate_candidates() for the full contract)
|
| virtual std::ostream & | print (std::ostream &os) const override |
| | writes "Sequential_Step_Straight(threads=N)" if the injected engine is threaded, else "Sequential_Step_Straight()"
|
|
void | enable_result_tracking (PResultTracker tracker) |
| | assigns a result tracker to this step, i.e., enables logging of all evaluated candidate subsets for future reuse (re-evaluation, etc.)
|
|
void | disable_result_tracking () |
| | detaches any result tracker (result_tracker_active() then returns false)
|
|
bool | result_tracker_active () const |
| | true if a result tracker was assigned via enable_result_tracking() and not since disabled
|
|
void | set_output_detail (OutputDetail detail) |
| | sets the amount of information that is logged to output stream throughout the course of search
|
|
OutputDetail | get_output_detail () const |
| | the currently configured output detail level
|
|
bool | output_normal () const |
| | true unless output detail is SILENT
|
|
bool | output_detailed () const |
| | true only at the DETAILED output level
|
template<class RETURNTYPE, typename DIMTYPE, class SUBSET, class CRITERION>
class FST::Sequential_Step_Straight_Threaded< RETURNTYPE, DIMTYPE, SUBSET, CRITERION >
DEPRECATED shim: threaded version of sequential selection step in sequential search type of methods.
- Deprecated
- Deprecated since FST4 4.0; scheduled for removal in the next major release — construct the merged class with a Candidate_Evaluator_Threaded engine instead.
Kept for source compatibility with earlier FST4 sources, written when the threaded and the sequential variant were separate classes. This class is now nothing but a Sequential_Step_Straight constructed with a Candidate_Evaluator_Threaded engine; prefer doing that directly in new code.
- Warning
- Criterion clones can go stale. On its first use the threaded engine clones the criterion object passed to evaluate_candidates() once per worker thread, and it re-uses those clones for as long as the same criterion object is passed in. The clones are never re-synchronized with the original criterion, so a change of the original's context does not reach them. This matters above all with Criterion_Wrapper, whose state depends on the current data split: if the split changes and the clones do not, the workers keep evaluating on the wrong part of the data. Re-create the step object (and with it the engine and its clones) whenever the primary criterion's context changes - typically after every data split change. The same applies to Sequential_Step_Straight itself whenever it is constructed with a Candidate_Evaluator_Threaded engine; see the class documentation of Candidate_Evaluator_Threaded.