Poll

interface Poll<S : ScoreMetrics, V : Vote>

This inteface represents the poll to be evaluated.

Inheritors

Properties

Link copied to clipboard
abstract var competition: Competition<S>

Definition of competition and its members.

Link copied to clipboard
abstract var pollAlgorithm: PollAlgorithm<S, V>

Algorithm chosen to compute the final ranking.

Link copied to clipboard
abstract var votesList: List<V>

Definition of votes.

Functions

Link copied to clipboard
abstract fun competition(compInit: Competition<S>.() -> Unit): Competition<S>

DSL-function which initializes a Competition.

Link copied to clipboard
abstract fun computePoll(): Ranking<S>

Computes the final ranking.

Link copied to clipboard

DSL-function which initializes MyCondorcetAlgorithm.

Link copied to clipboard
Link copied to clipboard
abstract infix fun String.then(s: String): List<String>
abstract infix fun List<String>.then(s: String): List<String>

Shortcut which allows competitors' name chaining in the list.

Link copied to clipboard
abstract operator fun Competition<S>.unaryMinus()

Shortcut which assigns the value to competition.

abstract operator fun PollAlgorithm<S, V>.unaryMinus()

Shortcut which assigns the value to pollAlgorithm.

Link copied to clipboard
abstract operator fun V.unaryPlus()

Shortcut to add a vote in votesList.

Link copied to clipboard
abstract infix fun String.votedBy(voterIdentifier: String): SinglePreferenceVote<S>

This function allows a shortcut to create a SinglePreferenceVote, given the name of Competitor voted by a Voter, distinguished by its identifier.

abstract infix fun List<String>.votedBy(voterIdentifier: String): ListOfPreferencesVote<S>

This function allows a shortcut to create a ListOfPreferencesVote, given the name list of Competitor voted by a Voter, distinguished by its identifier.