Class VotingEngine

java.lang.Object
org.episteme.social.politics.VotingEngine

public final class VotingEngine extends Object
An engine for calculating election winners using various social choice algorithms. Acts as a bridge between the data models (Ballot, Election) and the algorithmic implementations in ElectoralSimulations. Refactored to use the extensible VotingMethod registry.
Since:
1.0
Version:
2.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • resolve

      public static List<String> resolve(List<Ballot> ballots, String electionId, VotingMethod method, int seats)
      Resolves an election using the specified method and list of cast ballots.
      Parameters:
      ballots - the cast ballots
      electionId - the ID of the choice/election to process
      method - the voting algorithm
      seats - number of seats to fill
      Returns:
      list of winners
    • calculatePluralityWinner

      public static List<String> calculatePluralityWinner(List<Ballot> ballots, String electionId)
      Calculates the winner using Plurality (First-Past-The-Post).