35 #ifndef GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
36 #define GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
38 #include "../Util/GRTCommon.h"
39 #include "../CoreModules/PostProcessing.h"
49 this->classLabel = classLabel;
50 timer.
start(timeoutDuration);
54 bool set(UINT classLabel,
unsigned long timeoutDuration){
55 if( classLabel > 0 && timeoutDuration > 0 ){
56 this->classLabel = classLabel;
57 timer.
start(timeoutDuration);
64 UINT getClassLabel(){
return classLabel; }
139 virtual bool process(
const VectorDouble &inputVector);
148 virtual bool reset();
193 bool init(
unsigned long timeoutDuration,UINT filterMode = ALL_CLASS_LABELS);
201 UINT
filter(UINT predictedClassLabel);
252 enum FilterModes{ALL_CLASS_LABELS=0,INDEPENDENT_CLASS_LABELS};
255 UINT filteredClassLabel;
257 unsigned long timeoutDuration;
258 vector< ClassLabelAndTimer > classLabelTimers;
260 static RegisterPostProcessingModule< ClassLabelTimeoutFilter > registerModule;
265 #endif //GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
bool setFilterMode(UINT filterMode)
virtual bool loadModelFromFile(string filename)
ClassLabelTimeoutFilter & operator=(const ClassLabelTimeoutFilter &rhs)
UINT getFilteredClassLabel()
virtual bool deepCopyFrom(const PostProcessing *postProcessing)
virtual ~ClassLabelTimeoutFilter()
UINT filter(UINT predictedClassLabel)
signed long getMilliSeconds() const
bool timerReached() const
virtual bool process(const VectorDouble &inputVector)
virtual bool saveModelToFile(string filename) const
bool setTimeoutDuration(unsigned long timeoutDuration)
ClassLabelTimeoutFilter(unsigned long timeoutDuration=1000, UINT filterMode=ALL_CLASS_LABELS)