STAR++ v0.2.2
C++ implementation of STAR voting
Loading...
Searching...
No Matches
Star::Rank Struct Reference

The Rank struct represents a relative position for a given standing that can be occupied by multiple candidates. More...

#include <star/rank.h>

Public Types

enum  Order {
  Ascending ,
  Descending
}
 

Static Public Member Functions

static QList< RankrankSort (const QMap< QString, int > &valueMap, Order order=Descending)
 

Public Attributes

QSet< QString > candidates
 
int value
 

Detailed Description

This struct is generally used within a list in order to present overall candidate rankings for different metrics.

Member Enumeration Documentation

◆ Order

This enum represents the sort order of rankings.

Enumerator
Ascending 

Ascending sort order.

Descending 

Descending sort order.

Member Function Documentation

◆ rankSort()

QList< Rank > Star::Rank::rankSort ( const QMap< QString, int > &  valueMap,
Order  order = Descending 
)
static

Creates rankings of the candidates in the candidate-score map valueMap, sorted according to order.

Member Data Documentation

◆ candidates

QSet< QString > Star::Rank::candidates

The candidates that are part of the rank.

◆ value

int Star::Rank::value

The value that defines the rank.


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