Newer
Older
import (
"fmt"
)
func BordaSWF(p Profile) (count Count, err error) {
err = checkProfileFromProfile(p)
if err != nil {
return nil, err
}
nAlts := len(p[0])
for _, row := range p {
for i := 0; i < nAlts; i++ {
count[row[i]] += nAlts - 1 - i
}
func BordaSCF(p Profile) (bestAlts []Alternative, err error) {
count, err := BordaSWF(p)
if err != nil {
return nil, err
}
func Test_borda() {
profil := GenerateProfile(3, 5)