org.bolson.vote
Class RatedVotingSystem

java.lang.Object
  extended by org.bolson.vote.VotingSystem
      extended by org.bolson.vote.RatedVotingSystem
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Condorcet, GradualApproval, INR, IRNR, IRNRP, PairwiseRatingDifferentialSummation, RawRating

public abstract class RatedVotingSystem
extends VotingSystem

Interface for any voting system that inputs a voter's ratings of the choices. Supplies implementations of voteRanking which call voteRating

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.bolson.vote.VotingSystem
debug, NO_VOTE, numc
 
Constructor Summary
RatedVotingSystem(int numCandidates)
           
 
Method Summary
 int voteRanking(int[] ranking)
          Convert to Rating and pass to voteRating();
 int voteRating(double[] rating)
           
 int voteRating(int[] rating)
           
 
Methods inherited from class org.bolson.vote.VotingSystem
checkRatedVote, getDebugHTML, getDebugText, getNumberOfCandidates, getWinners, getWinners, getWinners, getWinners, htmlSummary, init, isValidRankedVote, isValidRatedVote, name, normalize, normalize, normalize, normalize, normalize, normalizeL2, normalizeL2, normalizeL2, normalizeL2, normalizeL2, stretch, toString, voteRating, voteRating
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatedVotingSystem

public RatedVotingSystem(int numCandidates)
Method Detail

voteRanking

public int voteRanking(int[] ranking)
Convert to Rating and pass to voteRating();

Specified by:
voteRanking in class VotingSystem
Parameters:
ranking - An array int[numc]. ranking[i] is the ranking of choice i.
Returns:
0 on success

voteRating

public int voteRating(int[] rating)
Specified by:
voteRating in class VotingSystem
Parameters:
rating - An array int[numc]. rating[i] is the rating of choice i. A rating can be any int value. Higher means more preferred. NO_VOTE for unrated.
Returns:
0 on success

voteRating

public int voteRating(double[] rating)
Specified by:
voteRating in class VotingSystem
Parameters:
rating - An array int[N]. rating[i] is the rating of choice i. A rating can be any int value. Higher means more preferred. NO_VOTE for unrated.
Returns:
0 on success