anpcpp 0.4.0
Analytic Network Process computational library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
anpcpp::NodePrioritizerSlot Struct Reference

Stores either pairwise or ratings judgments for one dest cluster. More...

#include <network.hpp>

Public Member Functions

const std::vector< std::string > & alternatives () const
 
bool empty () const
 
bool has_alternative (const std::string &name) const
 
void add_alternative (const std::string &name, bool ignore_existing=false)
 Adds name to the active prioritizer and all user tables.
 
void remove_alternative (const std::string &name, bool ignore_missing=false)
 Removes name from the active prioritizer and all user tables.
 
void rename_alternative (const std::string &old_name, const std::string &new_name)
 Renames an alternative in the active prioritizer and user tables.
 
Vector priorities () const
 
void set_kind (NodePrioritizerKind new_kind)
 Switches kind, preserving the alternative name list.
 
PairwiseJudgmentsensure_user_pairwise (const std::string &user_id)
 Ensures a user pairwise table exists (identity) for user_id.
 
RatingsPrioritizerensure_user_ratings (const std::string &user_id)
 Ensures a user ratings table exists for user_id.
 
void sync_ratings_scale_to_users ()
 Syncs categories/interpreter/mode from ratings into all users.
 

Public Attributes

std::map< std::string, PairwiseJudgmentsuser_pairwise
 Per-participant pairwise (same alternatives as pairwise).
 
std::map< std::string, RatingsPrioritizeruser_ratings
 Per-participant ratings votes.
 

Detailed Description

Stores either pairwise or ratings judgments for one dest cluster.

pairwise / ratings hold the effective judgments used by calc. Per-user tables live in user_pairwise / user_ratings; call AnpNetwork::rebuild_effective_judgments after edits or scope changes.

Member Function Documentation

◆ alternatives()

const std::vector< std::string > & anpcpp::NodePrioritizerSlot::alternatives ( ) const
Returns
Alternative names from the active prioritizer.

◆ empty()

bool anpcpp::NodePrioritizerSlot::empty ( ) const
Returns
True if the active prioritizer has no alternatives.

◆ has_alternative()

bool anpcpp::NodePrioritizerSlot::has_alternative ( const std::string &  name) const
Returns
True if name is an alternative in the active prioritizer.

◆ priorities()

Vector anpcpp::NodePrioritizerSlot::priorities ( ) const
Returns
Local priorities for the unscaled column.

◆ set_kind()

void anpcpp::NodePrioritizerSlot::set_kind ( NodePrioritizerKind  new_kind)

Switches kind, preserving the alternative name list.

Pairwise is reset to an identity diagonal; ratings start empty with numeric + Identity interpreter. User maps for the new kind are ensured empty shells matching alternatives.

Member Data Documentation

◆ user_ratings

std::map<std::string, RatingsPrioritizer> anpcpp::NodePrioritizerSlot::user_ratings

Per-participant ratings votes.

Shared scale (categories / interpreter / mode) is kept on ratings and synced into user tables when the scale changes.


The documentation for this struct was generated from the following file: