Skip to content
Snippets Groups Projects
Commit fd7d3385 authored by Balthazar Wilson's avatar Balthazar Wilson
Browse files

fix: copeland

parent b4b30880
No related branches found
No related tags found
1 merge request!9Copeland and stv
......@@ -10,8 +10,8 @@ func CopelandSWF(p Profile) (count Count, err error) {
if err != nil {
return nil, err
}
for alt1 := 0; alt1 < len(p); alt1++ {
for alt2 := alt1 + 1; alt2 < len(p); alt2++ {
for alt1 := 1; alt1 <= len(alts); alt1++ {
for alt2 := alt1 + 1; alt2 <= len(alts); alt2++ {
score1, score2 := 0, 0
for _, pref := range p {
if isPref(Alternative(alt1), Alternative(alt2), pref) {
......@@ -22,7 +22,9 @@ func CopelandSWF(p Profile) (count Count, err error) {
}
if score1 > score2 {
count[Alternative(alt1)]++
count[Alternative(alt2)]--
} else if score2 > score1 {
count[Alternative(alt1)]--
count[Alternative(alt2)]++
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment