sgns::neoswarm::reputation::WeightedConsensus¶
Selects the winning output from a set of node responses. More...
#include <weighted_consensus.hpp>
Public Classes¶
| Name | |
|---|---|
| struct | Config |
Public Types¶
| Name | |
|---|---|
| enum class uint8_t | Strategy |
Public Functions¶
| Name | |
|---|---|
| WeightedConsensus() | |
| WeightedConsensus(Config cfg) | |
| NodeOutput | SelectWinner(const std::vector< NodeOutput > & outputs) const Select the winning output from a set of node outputs. |
Detailed Description¶
Selects the winning output from a set of node responses.
weight_i = reputation_i / (perplexity_i + ε)
Strategy A (WeightedVoting): select O_k maximising Σ weight_i × (O_i == O_k) Strategy B (BestWeightedScore): select O_i maximising weight_i
Public Types Documentation¶
enum Strategy¶
| Enumerator | Value | Description |
|---|---|---|
| WeightedVoting | 0 | |
| BestWeightedScore | 1 |
Public Functions Documentation¶
function WeightedConsensus¶
function WeightedConsensus¶
function SelectWinner¶
Select the winning output from a set of node outputs.
Parameters:
- outputs Responses from all participating nodes.
Return: The winning NodeOutput (or the first if empty).
Updated on 2026-07-25 at 22:56:56 +0000