mirror of
				https://github.com/TomHarte/CLK.git
				synced 2025-11-04 00:16:26 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			511 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			511 B
		
	
	
	
		
			C++
		
	
	
	
	
	
//
 | 
						|
//  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::confidence() const {
 | 
						|
	return float(hits_) / float(hits_ + misses_);
 | 
						|
}
 | 
						|
 | 
						|
void ConfidenceCounter::add_hit() {
 | 
						|
	++hits_;
 | 
						|
}
 | 
						|
 | 
						|
void ConfidenceCounter::add_miss() {
 | 
						|
	++misses_;
 | 
						|
}
 | 
						|
 | 
						|
void ConfidenceCounter::add_equivocal() {
 | 
						|
	if(hits_ > misses_) {
 | 
						|
		++hits_;
 | 
						|
		++misses_;
 | 
						|
	}
 | 
						|
}
 |