1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-28 22:30:30 +00:00
CLK/Analyser/Dynamic/ConfidenceCounter.cpp

31 lines
509 B
C++
Raw Normal View History

//
// ConfidenceCounter.cpp
// Clock Signal
//
// Created by Thomas Harte on 21/01/2018.
// Copyright 2018 Thomas Harte. All rights reserved.
//
#include "ConfidenceCounter.hpp"
using namespace Analyser::Dynamic;
float ConfidenceCounter::get_confidence() {
return float(hits_) / float(hits_ + misses_);
}
void ConfidenceCounter::add_hit() {
2020-05-10 03:42:42 +00:00
++hits_;
}
void ConfidenceCounter::add_miss() {
2020-05-10 03:42:42 +00:00
++misses_;
}
void ConfidenceCounter::add_equivocal() {
2018-02-12 01:32:21 +00:00
if(hits_ > misses_) {
2020-05-10 03:42:42 +00:00
++hits_;
++misses_;
2018-02-12 01:32:21 +00:00
}
}