anpcpp 0.4.0
Analytic Network Process computational library
Loading...
Searching...
No Matches
multiuser.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cmath>
9#include <map>
10#include <string>
11#include <vector>
12
13#include "anpcpp/pairwise.hpp"
14#include "anpcpp/ratings.hpp"
15
16namespace anpcpp {
17
20 std::string id;
21 std::string name;
22 std::string email;
23};
24
27 std::string id;
28 std::string name;
29 std::vector<std::string> member_ids;
30};
31
35 Average,
39 Group,
40};
41
52
54inline constexpr const char* kDefaultParticipantId = "default";
55
63 const std::vector<const PairwiseJudgments*>& inputs,
65
75 const std::vector<const RatingsPrioritizer*>& inputs,
76 const RatingsPrioritizer& scale_template,
78
83
89
92 double min = 0.0;
93 double max = 0.0;
95 double ratio = 0.0;
96 int contributor_count = 0;
97};
98
101 std::string alt;
102 double min = 0.0;
103 double max = 0.0;
105 double range = 0.0;
106 int contributor_count = 0;
107};
108
111 std::size_t filled = 0;
112 std::size_t needed = 0;
113};
114
122[[nodiscard]] std::vector<std::vector<PairwiseCellDisagreement>>
123pairwise_disagreement(const std::vector<const PairwiseJudgments*>& inputs);
124
132[[nodiscard]] std::vector<RatingsAltDisagreement> ratings_disagreement(
133 const std::vector<const RatingsPrioritizer*>& inputs,
134 const std::vector<std::string>& alt_order = {});
135
140 const PairwiseJudgments& pw);
141
146 const RatingsPrioritizer& rt);
147
156 std::vector<double> values;
157 double min = 0.0;
158 double max = 0.0;
160 double mean = 0.0;
161 double band_low = 0.0;
162 double band_high = 0.0;
164 double alignment_pct = 0.0;
165 int contributor_count = 0;
166};
167
169inline constexpr double kPairwiseAlignmentSpanRatio = 81.0;
170
177[[nodiscard]] double pairwise_alignment_pct(double min_v, double max_v);
178
184[[nodiscard]] double ratings_alignment_pct(double range, double full_scale);
185
190 const std::vector<double>& values);
191
196 const std::vector<double>& values, double full_scale = 1.0);
197
198} // namespace anpcpp
Square pairwise comparison table over a named list of alternatives.
Definition pairwise.hpp:21
Ratings table over named alternatives for one (wrt node, dest cluster).
Definition ratings.hpp:85
Analytic Network Process computational library.
Definition eigen.hpp:14
double ratings_alignment_pct(double range, double full_scale)
Ratings alignment from intensity range vs full_scale.
void copy_ratings_votes_into(const RatingsPrioritizer &src, RatingsPrioritizer &out)
Copy votes from src into out, syncing mode/scale from src.
VoteSpreadSummary summarize_pairwise_votes(const std::vector< double > &values)
Geometric mean / SD spread for positive pairwise ratios.
void copy_pairwise_into(const PairwiseJudgments &src, PairwiseJudgments &out)
Copy src pairwise into out (alternatives aligned to out).
constexpr const char * kDefaultParticipantId
Default participant id used when migrating single-user (v1) models.
Definition multiuser.hpp:54
void aggregate_pairwise_geometric(const std::vector< const PairwiseJudgments * > &inputs, PairwiseJudgments &out)
Geometric mean of pairwise ratios into out (same alternatives).
VoteSpreadSummary summarize_ratings_votes(const std::vector< double > &values, double full_scale=1.0)
Arithmetic mean / SD spread for ratings intensities.
void aggregate_ratings_arithmetic(const std::vector< const RatingsPrioritizer * > &inputs, const RatingsPrioritizer &scale_template, RatingsPrioritizer &out)
Arithmetic mean of rating intensity scores into out.
double pairwise_alignment_pct(double min_v, double max_v)
Pairwise alignment from min/max ratios.
JudgmentScopeKind
Whose judgments feed the effective calc slot.
Definition multiuser.hpp:33
@ Group
Named group members only.
@ Average
Geometric / arithmetic average over all participants with data.
@ Participant
Single participant.
std::vector< std::vector< PairwiseCellDisagreement > > pairwise_disagreement(const std::vector< const PairwiseJudgments * > &inputs)
Per upper-triangle cell max/min ratio across inputs.
constexpr double kPairwiseAlignmentSpanRatio
max/min span that maps to 0% alignment on the Saaty strip (9 ÷ 1/9).
Definition multiuser.hpp:169
JudgmentFillCounts ratings_fill_counts(const RatingsPrioritizer &rt)
Count present ratings votes vs number of alternatives.
JudgmentFillCounts pairwise_fill_counts(const PairwiseJudgments &pw)
Count filled upper-triangle cells (comparison != 0) vs needed.
std::vector< RatingsAltDisagreement > ratings_disagreement(const std::vector< const RatingsPrioritizer * > &inputs, const std::vector< std::string > &alt_order={})
Per-alternative intensity range across inputs.
Named pairwise comparison tables.
Ratings-based node prioritizers (categorical or numeric).
Filled vs needed judgment counts for coverage grids.
Definition multiuser.hpp:110
Named subset of participants for group-scope analysis.
Definition multiuser.hpp:26
A judge on a model (model-scoped, not an app account).
Definition multiuser.hpp:19
Document session: which judgments are active for editing/calc.
Definition multiuser.hpp:47
std::string id
Participant or group id when kind is Participant or Group.
Definition multiuser.hpp:50
Disagreement stats for one pairwise upper-triangle cell.
Definition multiuser.hpp:91
double ratio
max/min when contributor_count >= 2; else 0.
Definition multiuser.hpp:95
Disagreement stats for one ratings alternative.
Definition multiuser.hpp:100
double range
max - min when contributor_count >= 2; else 0.
Definition multiuser.hpp:105
Summary of collected votes for one comparison / ratings alternative.
Definition multiuser.hpp:155
double mean
Geometric mean (pairwise) or arithmetic mean (ratings).
Definition multiuser.hpp:160
double alignment_pct
0–100; 100 when all votes equal (or a single vote).
Definition multiuser.hpp:164