|
|||||||||
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.RatedVotingSystem org.bolson.vote.INR
public class INR
Iterated Normalized Ratings I don't know how useful this is. Maybe it's always the same as straight rating summation. dunno.
Field Summary | |
---|---|
protected double[] |
talley
|
Fields inherited from class org.bolson.vote.VotingSystem |
---|
debug, NO_VOTE, numc |
Constructor Summary | |
---|---|
INR(int numCandidates)
|
Method Summary | |
---|---|
static java.lang.String |
doubleToStrLen(double d,
int l)
|
java.lang.String |
getDebugHTML(java.lang.String[] names)
Return HTML representation of debug data. |
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 |
voteRating(double[] rating)
|
int |
voteRating(float[] rating)
|
int |
voteRating(int[] rating)
|
Methods inherited from class org.bolson.vote.RatedVotingSystem |
---|
voteRanking |
Methods inherited from class org.bolson.vote.VotingSystem |
---|
checkRatedVote, 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 double[] talley
Constructor Detail |
---|
public INR(int numCandidates)
Method Detail |
---|
public static java.lang.String doubleToStrLen(double d, int l)
public java.lang.String name()
VotingSystem
name
in class VotingSystem
public VotingSystem init(java.lang.String[] argv)
VotingSystem
init
in class VotingSystem
vs = (new VS(numc)).init( new String[]{"blah", "grunt"} );
public int voteRating(int[] rating)
voteRating
in class RatedVotingSystem
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.
public int voteRating(float[] rating)
voteRating
in class VotingSystem
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.
public int voteRating(double[] rating)
voteRating
in class RatedVotingSystem
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.
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 toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String[] names)
VotingSystem
toString
in class VotingSystem
names
- The names of the choices.
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 getDebugHTML(java.lang.String[] names)
VotingSystem
getDebugHTML
in class VotingSystem
names
- Symbolic names for the choices makes human debugging easier. May be null.
VotingSystem.debug
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |