2018-01-23 02:39:23 +00:00
|
|
|
//
|
|
|
|
// ConfidenceSummary.hpp
|
|
|
|
// 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
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2018-01-23 02:39:23 +00:00
|
|
|
|
|
|
|
#include "ConfidenceSource.hpp"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Analyser::Dynamic {
|
2018-01-23 02:39:23 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Summaries a collection of confidence sources by calculating their weighted sum.
|
|
|
|
*/
|
|
|
|
class ConfidenceSummary: public ConfidenceSource {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Instantiates a summary that will produce the weighted sum of
|
|
|
|
@c sources, each using the corresponding entry of @c weights.
|
|
|
|
|
|
|
|
Requires that @c sources and @c weights are of the same length.
|
|
|
|
*/
|
|
|
|
ConfidenceSummary(
|
|
|
|
const std::vector<ConfidenceSource *> &sources,
|
|
|
|
const std::vector<float> &weights);
|
|
|
|
|
|
|
|
/*! @returns The weighted sum of all sources. */
|
2020-01-24 03:57:51 +00:00
|
|
|
float get_confidence() final;
|
2018-01-23 02:39:23 +00:00
|
|
|
|
|
|
|
private:
|
2020-05-10 03:42:42 +00:00
|
|
|
const std::vector<ConfidenceSource *> sources_;
|
|
|
|
const std::vector<float> weights_;
|
2018-01-23 02:39:23 +00:00
|
|
|
float weight_sum_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|