2018-01-22 21:39:23 -05:00
|
|
|
//
|
|
|
|
// ConfidenceCounter.cpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 21/01/2018.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-22 21:39:23 -05:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "ConfidenceCounter.hpp"
|
|
|
|
|
2018-01-28 22:22:21 -05:00
|
|
|
using namespace Analyser::Dynamic;
|
2018-01-22 21:39:23 -05:00
|
|
|
|
2018-01-25 19:02:16 -05:00
|
|
|
float ConfidenceCounter::get_confidence() {
|
2018-01-22 21:39:23 -05: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-11 20:32:21 -05:00
|
|
|
if(hits_ > misses_) {
|
|
|
|
hits_++;
|
|
|
|
misses_++;
|
|
|
|
}
|
2018-01-22 21:39:23 -05:00
|
|
|
}
|