1#ifndef FSTRESULTTRACKER_H
2#define FSTRESULTTRACKER_H
90template<
class RETURNTYPE,
class SUBSET>
91class Result_Tracker :
public Clonable {
105 virtual bool add(
const RETURNTYPE value,
const PSubset sub)=0;
107 virtual std::size_t
size()
const =0;
110 virtual void join(Result_Tracker &src);
112 Result_Tracker*
clone()
const override {
throw fst_error(
"Result_Tracker::clone() not supported, use Result_Tracker::stateless_clone() instead.");}
113 Result_Tracker*
sharing_clone()
const override {
throw fst_error(
"Result_Tracker::sharing_clone() not supported, use Result_Tracker::stateless_clone() instead.");}
124template<
class RETURNTYPE,
class SUBSET>
Abstract class, defines interface for classes that enable collecting multiple results.
Definition result_tracker.hpp:91
virtual void join(Result_Tracker &src)
adds the contents of src to this tracker, one add() per record, so this tracker's own inclusion rules...
Definition result_tracker.hpp:125
OutputDetail _detail
the output detail level set via set_output_detail(); read by output_normal()/output_detailed()
Definition result_tracker.hpp:121
Result_Tracker * clone() const override
Definition result_tracker.hpp:112
virtual void clear()=0
discards all recorded results
virtual bool add(const RETURNTYPE value, const PSubset sub)=0
records one (value, subset) result; returns false if the tracker declines to keep it (concrete tracke...
std::shared_ptr< SUBSET > PSubset
shared pointer to a tracked feature subset
Definition result_tracker.hpp:93
bool output_detailed() const
true only at the DETAILED output level
Definition result_tracker.hpp:119
bool output_normal() const
true unless output detail is SILENT
Definition result_tracker.hpp:118
virtual std::size_t size() const =0
number of results currently held (std::size_t rather than 'long': on LLP64 platforms 'long' is 32 bit...
Result_Tracker * sharing_clone() const override
Definition result_tracker.hpp:113
Result_Tracker(const Result_Tracker &rt)
copies the output-detail setting only – concrete trackers copy their own collected results separately
Definition result_tracker.hpp:95
ResultRec * PResultRec
raw pointer to a ResultRec, as used by get_first()/get_next() iteration
Definition result_tracker.hpp:103
Result_Tracker * stateless_clone() const override=0
virtual bool get_next(PResultRec &r)=0
hands out the next held result; false once the iteration is exhausted. A tracker has a single shared ...
void set_output_detail(OutputDetail detail)
sets the amount of information that is logged to output stream throughout the course of search
Definition result_tracker.hpp:116
virtual bool get_first(PResultRec &r)=0
starts an iteration over the held results, best first; false if the tracker holds nothing....
OutputDetail get_output_detail() const
the currently configured output detail level
Definition result_tracker.hpp:117
FST4 specific error passing class.
Definition error.hpp:61
Defines interface for classes that may need to get cloned.
FST4 specific error passing class.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
OutputDetail
search algorithms' output extent
Definition global.hpp:67
@ NORMAL
informs about new found solutions and time elapsed etc.
Definition global.hpp:69
@ DETAILED
includes much detail including variable contents etc. (may render output unreadably cluttered)
Definition global.hpp:70
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
Structure to hold [subset,criterion value] temporary solutions in the course of search.
Definition result_tracker.hpp:99
RETURNTYPE value
the criterion value of the recorded subset
Definition result_tracker.hpp:100
PSubset sub
the recorded subset itself
Definition result_tracker.hpp:101