LiamM32 / Eurovision_Condorcet

A program to count votes for the Eurovision Song Contest using a redesigned voting system.
1 stars 2 forks source link

Incorrect vote counts for each tag/country #4

Closed LiamM32 closed 1 year ago

LiamM32 commented 1 year ago

The Contest::countVotersByCountry() function is supposed to count the number of votes coming from each country. Each vote is supposed to have a 3-letter country code as a tag. But when used with the included some-votes.cvotes file, it only counts the first set of identical votes listed for each country. But every country should have two sets of votes.

For example, here are the votes from Albania, as written as lines in some-votes.cvotes:

ALB || ITA > SWE > HRV > CYP > FIN > ISR > NOR > FRA > SVN > POL *19
ALB || SWE > ARM > EST > EST > CHE > ISR > ISR > BEL > CYP > CYP *10

So Albania should have given 29 votes in total. But only 19 are counted in this function. I have not yet determined if the second set of votes are ignored entirely throughout the process.

julien-boudry commented 1 year ago

Your set of the vote, on the second part, seems to be wrong, candidates are duplicated on the same vote. ALB || SWE > ARM > EST > EST > CHE > ISR > ISR > BEL > CYP > CYP *10

Currently, CondorcetElectionFormat readers just ignore badly formatted votes, without any warning. Maybe more options (to throw something) can be added for the next version.

LiamM32 commented 1 year ago

Thank you for pointing this out. I used Libreoffice Calc to generate these votes based on some existing data. It was a problem with how I copied & pasted things into libreoffice that caused this to happen.