|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bolson.vote.VotingSystem org.bolson.vote.RankedVotingSystem org.bolson.vote.Bucklin
public class Bucklin
Bucklin election method. May be mathematically flawed, and is as computationally inconvenient as IRV.
Field Summary | |
---|---|
protected java.util.Vector |
votes
|
Fields inherited from class org.bolson.vote.VotingSystem |
---|
debug, NO_VOTE, numc |
Constructor Summary | |
---|---|
Bucklin(int numCandidates)
|
Method Summary | |
---|---|
int[] |
getWinners()
Do processing if necessary, return winners. |
java.lang.String |
htmlSummary(java.lang.String[] names)
A fancy html representation. |
VotingSystem |
init(java.lang.String[] argv)
Arguments to modify behavior of VotingSystem |
java.lang.String |
name()
Return name of this voting system. |
java.lang.String |
toString()
|
java.lang.String |
toString(java.lang.String[] names)
A more interesting representation. |
int |
voteRanking(int[] ranking)
|
Methods inherited from class org.bolson.vote.RankedVotingSystem |
---|
voteRating, voteRating, voteRating |
Methods inherited from class org.bolson.vote.VotingSystem |
---|
checkRatedVote, getDebugHTML, getDebugText, getNumberOfCandidates, getWinners, getWinners, getWinners, isValidRankedVote, isValidRatedVote, normalize, normalize, normalize, normalize, normalize, normalizeL2, normalizeL2, normalizeL2, normalizeL2, normalizeL2, stretch, voteRating |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector votes
Constructor Detail |
---|
public Bucklin(int numCandidates)
Method Detail |
---|
public VotingSystem init(java.lang.String[] argv)
VotingSystem
init
in class VotingSystem
vs = (new VS(numc)).init( new String[]{"blah", "grunt"} );
public java.lang.String name()
VotingSystem
name
in class VotingSystem
public int voteRanking(int[] ranking)
voteRanking
in class VotingSystem
ranking
- An array int[N].
ranking[i] is the ranking of choice i.
rankings are 1 (most preferred) through N (least).
INT_MAX, N, or NO_VOTE for unspecified.
public int[] getWinners()
VotingSystem
It is recommended to cache the return value in such a way that calling this function again does not do complex recalculation. That cache should be cleared if voteRating or voteRanking is called.
getWinners
in class VotingSystem
public java.lang.String htmlSummary(java.lang.String[] names)
VotingSystem
htmlSummary
in class VotingSystem
names
- The names of the choices. May be null.
public java.lang.String toString(java.lang.String[] names)
VotingSystem
toString
in class VotingSystem
names
- The names of the choices.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |