To-do list:
Write to-do listDONE!!!Cross off first itemDONE!!!Write [design notes](design notes.md)DONE!!!- Implement solution as guided by the design notes:
Display the title and license information.DONE!!!Determine what is requested from simulations.DONE!!!Parse given options.DONE!!!Display usage information and exit, if required.DONE!!!Determine the mode to run in based on such parsing.DONE!!!- Determine what statistics to collect based on such parsing.
- Load serialized data if required.
- Generate data:
- Run simulations:
- Determine the number of elections to run.
- For each election:
Prepare the election scenario:DONE!!!Determine the number of Candidates.DONE!!!Determine the number of Voters.DONE!!!For Each Voter:DONE!!!For Each Candidate:DONE!!!Determine the actual utility of the Candidate to the Voter.(We can adjust this later to focus on multiple issues.)
Determine the degree of Voter ignorance.(Currently using a pseudo-random normally distributed number for the perceived utility; We can change this later.)For Each Voter:DONE!!!For Each Candidate:DONE!!!Determine the perceived utility of the Candidate to the Voter based on the degree of Voter ignorance.(Currently using a pseudo-random normally distributed number for the perceived utility; We can change this later.)
Identify honest Voters and strategic VotersDONE!!!Determine the number of Voters which vote honestly and the number which vote strategically.DONE!!!Determine the ideal ratio of Voters voting honestly to Voters voting strategically.DONE!!!Determine what ratio of honest Voters and of strategic Voters from the election's entire electorate most closely matches that ratio.DONE!!!
Randomly select Voters to vote honestly or strategically in accordance with those numbers.DONE!!!
Determine the Candidate with the "optimum societal utility".DONE!!!For each Candidate:DONE!!!Sum the actual utilities of that Candidate to the Voters.DONE!!!
If exactly 1 Candidate has the highest actual utility sum:DONE!!!Record that Candidate as the 1 with the "optimum societal utility".DONE!!!
If more than 1 Candidate has the highest actual utility sum:DONE!!!Choose 1 of the Candidates with the highest actual utility sum.DONE!!!Record that randomly chosen Candidate as the 1 with the "optimum societal utility".DONE!!!
Determine the True Condorcet Candidate.DONE!!!Sort Each Voter's preferences of Candidates by actual utilities.DONE!!!For Each Candidate, A:DONE!!!For Each OTHER Candidate, B:DONE!!!Determine Who is elected in a 1-on-1 plurality election based on actual utilities.DONE!!!Start with 0 votes for both A and B.DONE!!!For Each Voter:DONE!!!Get ranking of A.DONE!!!Get ranking of B.DONE!!!If A is ranked higher than B, record a vote for A.DONE!!!If B is ranked higher than A, record a vote for B.DONE!!!If A has more votes recorded than B, record A as elected over B.DONE!!!If B has more votes recorded than A, record B as elected over A.DONE!!!If A and B have the same number of votes recorded, one of the two is randomly selected and considered elected over the Other.DONE!!! (Note: other methods use other tie breaking means.)
If A would be elected over All Other Candidates in these 1-on-1 plurality elections:DONE!!!Record A as the True Condorcet Candidate.DONE!!!
If there is no Candidate selected as the True Condorcet Candidate:DONE!!!Record the fact the election has no True Condorcet Candidate.DONE!!!
- For each voting method:
- Determine the Candidate elected by this method in this election.
- Determine the Condorcet Candidate. ("CW wins 1-on-1 versus X, for all rivals X.")
- Sort Each Voter's preferences of Candidates in accordance with the Voter's voting nature; in the event of equal perceived utility between 2 Candidates, order the 2 Candidates at random.
- For Each Voter:
- If the Voter is an honest Voter:
- Sort Candidates by perceived utility
- If the Voter is a strategic Voter:
- Utilize the "moving average strategy" to adjust the Voter's perspective of Each Candidate:
- Of the first 2 Candidates with the higher perceived utility, rank that Candidate first and the other last.
- For Each Candidates after the first 2:
- If the average perceived utility of the Candidate is above the average perceived utility of the preceding Candidates:
- Rank that Candidate in the next avilable highest position.
- If the average perceived utility of the Candidate is below the average perceived utility of the preceding Candidates:
- Rank that Candidate in the next avilable lowest position.
- If the average perceived utility of the Candidate equals the average perceived utility of the preceding Candidates:
- Rank that Candidate in either the next avilable highest or lowest position based on a coin flip.
- For Each Voter:
- For Each Candidate, A:
- For Each OTHER Candidate, B:
- Determine Who is elected in a 1-on-1 plurality election based on perceived utilities.
- Start with 0 votes for both A and B.
- For Each Voter:
- Get ranking of A.
- Get ranking of B.
- If A is ranked higher than B, record a vote for A.
- If B is ranked higher than A, record a vote for B.
- If A has more votes recorded than B, record A as elected over B.
- If B has more votes recorded than A, record B as elected over A.
- If A and B have the same number of votes recorded, one of the two is randomly selected and considered elected over the Other. (Note: other methods use other tie breaking means.)
- If A would be elected over All Other Candidates in these 1-on-1 plurality elections:
- A is the Condorcet Candidate.
- For Each OTHER Candidate, B:
- If there is no Candidate selected as the Condorcet Candidate, there is no Condorcet Candidate.
- Sort Each Voter's preferences of Candidates in accordance with the Voter's voting nature; in the event of equal perceived utility between 2 Candidates, order the 2 Candidates at random.
- Determine the Condorcet Candidate. ("CW wins 1-on-1 versus X, for all rivals X.")
- Determine the Candidate elected by this method in this election.
- Collect statistics from each simulation if required:
- For each election:
- For each voting method:
- Collect required Bayesian Regret statistics:
- Collect the method’s Bayesian Regret for the particular election if required.
- Collect the method’s Bayesian Regret per Voter for the particular election if required.
- Collect required IBR statistics:
- For Each Voter:
- Collect the IBR produced by this method for this election if required.
- Collect the arithmetic mean of the IBRs produced by this method for this election if required.
- Collect the standard deviation of the IBRs produced by this method for this election if required.
- Collect the fraction of Voters for Whom this method resulted in the least IBR for this election if required.
- For Each Voter:
- Collect required Condorcet agreements:
- Collect Condorcet Candidate agreement of this method for this election if required.
- Collect True Condorcet Candidate agreement of this method for this election if required.
- Collect required Bayesian Regret statistics:
- For each voting method:
- For each election:
- Analyze collected statistics if required:
- For each voting method:
- Collect Bayesian Regret statistics for this method from all elections if required.
- Collect arithmetic mean of Bayesian Regret per Voter from all elections for this method if required.
- Collect standard deviation of Bayesian Regret per Voter from all elections for this method if required.
- Collect IBR statistics for this method from all elections if required.
- For Each Voter:
- Collect the arithmetic mean of the IBRs from all elections if required.
- Collect the standard deviation of the IBRs if required.
- Collect the fraction of elections the particular method results in the least IBR for the largest fraction of Voters if required.
- Collect the fraction of Voters for Whom the particular voting method resulted in the least IBR if required.
- For Each Voter:
- Collect Condorcet agreement rates for this method from all elections if required:
- Collect the fraction of elections in which this method elects the Condorcet Candidate if required.
- Collect the fraction of elections in which this method elects the True Condorcet Candidate if required.
- Collect Bayesian Regret statistics for this method from all elections if required.
- For each voting method:
- Run simulations:
- Compare generated data with serialized data if required, reporting any difference.
- Compare simulation data, reporting any difference.
- For each election:
- Compare each election scenario's data, reporting any difference.
- Compare each voting method's information, reporting any difference.
- For each election:
- Compare election statistics, reporting any difference.
- For each election:
- For each voting method:
- Compare Bayesian Regret statistics:
- Compare the method’s Bayesian Regret for the particular election, reporting any difference.
- Compare the method’s Bayesian Regret per Voter for the particular election, reporting any difference.
- Compare IBR statistics:
- For Each Voter:
- Compare the IBR produced by this method for this election, reporting any difference.
- Compare the arithmetic mean of the IBRs produced by this method for this election, reporting any difference.
- Compare the standard deviation of the IBRs produced by this method for this election, reporting any difference.
- Compare the fraction of Voters for Whom this method resulted in the least IBR for this election, reporting any difference.
- For Each Voter:
- Compare Condorcet agreements:
- Compare Condorcet Candidate agreement of this method for this election, reporting any difference.
- Compare True Condorcet Candidate agreement of this method for this election, reporting any difference.
- Compare Bayesian Regret statistics:
- For each voting method:
- For each election:
- Compare analysis statistics:
- For each voting method:
- Compare Bayesian Regret statistics for this method from all elections, reporting any difference.
- Compare IBR statistics for this method from all elections, reporting any difference.
- Compare Condorcet agreement rates for this method from all elections:
- Compare the fraction of elections in which this method elects the Condorcet Candidate, reporting any difference.
- Compare the fraction of elections in which this method elects the True Condorcet Candidate, reporting any difference.
- For each voting method:
- Compare simulation data, reporting any difference.
- Serialize data if required.
- Output requested results:
- Collect requested results from the simulation(s) and/or associated statistics.
- Output the collected results.