(map-ballot f ballot)
Replace the value associated with each candidate in a ballot with the result of applying f to it.
Useful for e.g. converting ranked ballot to a ballot suitable for approval voting.
Replace the value associated with each candidate in a ballot with the result of applying f to it. Useful for e.g. converting ranked ballot to a ballot suitable for approval voting.
(pairwise-preferred ballot cands)
Given two candidates in cands, returns the preferred of those candidates in ballot. Returns nil if neither is preferred over the other.
Given two candidates in cands, returns the preferred of those candidates in ballot. Returns nil if neither is preferred over the other.
(top-ranked ballot)
Returns the most-preferred candidate on the ballot. If there are multiple such candidates one is chosen in an undefined way.
Returns the most-preferred candidate on the ballot. If there are multiple such candidates one is chosen in an undefined way.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close