2018-01-23 02:39:23 +00:00
|
|
|
//
|
|
|
|
// ConfidenceCounter.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 21/01/2018.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-23 02:39:23 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "ConfidenceCounter.hpp"
|
|
|
|
|
2018-01-29 03:22:21 +00:00
|
|
|
using namespace Analyser::Dynamic;
|
2018-01-23 02:39:23 +00:00
|
|
|
|
2018-01-26 00:02:16 +00:00
|
|
|
float ConfidenceCounter::get_confidence() {
|
2018-01-23 02:39:23 +00:00
|
|
|
return static_cast<float>(hits_) / static_cast<float>(hits_ + misses_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfidenceCounter::add_hit() {
|
|
|
|
hits_++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfidenceCounter::add_miss() {
|
|
|
|
misses_++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfidenceCounter::add_equivocal() {
|
2018-02-12 01:32:21 +00:00
|
|
|
if(hits_ > misses_) {
|
|
|
|
hits_++;
|
|
|
|
misses_++;
|
|
|
|
}
|
2018-01-23 02:39:23 +00:00
|
|
|
}
|