Comments (11)
Alright. Maybe the most cost-effective solution would be a warning that says "Warning: There is only one candidate in this election. Make sure to separate candidates with semicolons."
from condorcet.
Done with b5f502e
from condorcet.
Hi @LiamM32,
Can you illustrate this with a real example? Or better, write a failed test to resolve it. (in this file: https://github.com/julien-boudry/Condorcet/blob/master/Tests/src/Tools/Converters/CondorcetElectionFormatTest.php )
Thanks,
from condorcet.
So is this a bug then? I can attempt this when I'm back at my computer.
from condorcet.
So is this a bug then? I can attempt this when I'm back at my computer.
Not sure to understand well your problem. I prefer to execute the same as yours, It will be quicker to really capture the point.
from condorcet.
Enter the candidates
====================
Candidates: Enter each candidate names
Please register candidate N°1 (or press enter to continue):
> A,B,C
Please register candidate N°2 (or press enter to continue):
>
Should the votes be interpreted implicitly (candidates not mentioned come last)? (yes/no) [yes]:
>
Enter the votes
===============
Format: Candidate B > CandidateName D > CandidateName C = CandidateName A
Please register vote N°1 (or press enter to continue):
> A>B
Please register vote N°2 (or press enter to continue):
>
Enter the methods
=================
Voting methods: Choose by entering their numbers separated by commas. Press enter for the default method.
Select methods [Schulze Winning]:
[0 ] ALL
[1 ] BordaCount
[2 ] Copeland
[3 ] Dodgson Quick
> 2
-------------------------------------------
1 candidate registered || 1 vote registered
Configuration
=============
------------------------------------------------------------- -------
Is vote weight allowed? FALSE
------------------------------------------------------------- -------
Votes are evaluated according to the implicit ranking rule? TRUE
------------------------------------------------------------- -------
Is vote tie in rank allowed? TRUE
------------------------------------------------------------- -------
Results per methods
===================
===============================
| |
| Vote Method Copeland |
| |
===============================
★ Condorcet Winner || ⚐ Condorcet Loser
+----------------------+----- Results: Copeland ----------------------------+
| Rank | Candidates |
+----------------------+----------------------------------------------------+
| 1 | A,B,C ★ |
+----------------------+----------------------------------------------------+
Look like that?
The fact is that Vote 1 is invalid, and there is only one candidate named "A,B,C"
from condorcet.
Yes, but in a .cvotes file.
from condorcet.
It should be the same case, not specific to c.votes files. In my example, if you use a semicolon instead commo, it's working as you want.
from condorcet.
I've changed the separators in the console display to use semi-colons instead of commas. It's more consistent with the inputs and makes it impossible to mix up readings in those ambiguous (but unlikely) cases where candidate names contain commas and can match.
from condorcet.
I was wrong when I said that using commas instead of semicolons causes the results to be in the order that they were written in. Actually, using the attached file wikipedia_wrong.cvotes (actually wikipedia_wrong.txt) makes only one candidate called "A, B, C, D, E". Being the only candidate, they are the winner. But someone who made this mistake may think that this is a list of candidates from first place to last place.
wikipedia_wrong.txt
wikipedia.txt
I'm not closing with this comment, as it's a suggestion, not a bug report. Though I think this is a low priority.
In some cases, someone may want to write candidate names like "Eby, David", which is a justification for only accepting semicolons. Perhaps it can allow commas as the separator only if there are no semicolons present.
from condorcet.
Perhaps it can allow commas as the separator only if there are no semicolons present.
It would be horribly ambiguous. I think of it's only a display problem, and only for command line render.
It's more logic since commit above, using semilicolon as well for display (tie candidates name and tags).
from condorcet.
Related Issues (20)
- Console: Check false or null php.ini memory_limit on large election HOT 1
- PHP Fatal error HOT 7
- Largest remainder methods: Half votes rounded down, party receiving less seats HOT 5
- Unserialize crash with new && empty election object
- Implement VoteFaire Ranking (Popularity)?
- [Public API Reform] Pairwise key 'null' to 'tie'
- [Public API Reform] Split $election->getResult methods, for filtering by tags
- [Public API Reform] Is it useful to edit candidate name with history. Should be immutable?
- [Public API Reform] Do a really independant Pairwise object HOT 5
- [Command Line] Error importing CondorcetFormat: Argument #1 ($callBack) must be of type Closure HOT 6
- $election->getResult() results in error when there are 0 votes HOT 3
- Investigate about removeVote feature and Pairwise integrity
- Different results when running different numbers of methods HOT 4
- Problem in Schulze_Proportional_Prefilter in Experimental/Schulze-STV branch HOT 5
- [Public API Reform] Remove static setters setMaxParseIteration / setMaxVoteNumber HOT 1
- Tests: parallel mod (paratest, pest --parallel) fail erratically and inconsistently (and worse with JIT) HOT 3
- [Experimental Schulze-STV Branch] Wrong test results from various methods with Explicit Ranking HOT 14
- New Method: Smith Set HOT 1
- New method: STAR Voting HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from condorcet.