|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.bolson.vote.VotingSystem
org.bolson.vote.RatedVotingSystem
org.bolson.vote.IRNRP
public class IRNRP
Instant Runoff Normalized Ratings Proportional
IRNR,
Serialized Form| Field Summary | |
|---|---|
protected double[] |
talley
|
| Fields inherited from class org.bolson.vote.VotingSystem |
|---|
debug, NO_VOTE, numc |
| Constructor Summary | |
|---|---|
IRNRP(int numCandidates)
In addition to interfaced methods, there shall be a constructor taking the integer number N of choices to be voted on. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDebugText(java.lang.String[] names)
Return textual representation of debug data. |
protected void |
getScaledDoubleVote(double[] dt,
java.lang.Object o,
double weight,
boolean[] active)
|
int[] |
getWinners()
Do processing if necessary, return winners. |
int[] |
getWinners(int numSeats)
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 IRNRP |
java.lang.String |
name()
Return name of this voting system. |
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, getDebugHTML, getNumberOfCandidates, 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, toString, wait, wait, wait |
| Field Detail |
|---|
protected double[] talley
| Constructor Detail |
|---|
public IRNRP(int numCandidates)
| Method Detail |
|---|
public VotingSystem init(java.lang.String[] argv)
init in class VotingSystemvs = (new VS(numc)).init( new String[]{"blah", "grunt"} );public int voteRating(int[] rating)
voteRating in class RatedVotingSystemrating - 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 VotingSystemrating - 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 RatedVotingSystemrating - 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()
getWinners in class VotingSystem
protected void getScaledDoubleVote(double[] dt,
java.lang.Object o,
double weight,
boolean[] active)
public int[] getWinners(int numSeats)
getWinners in class VotingSystemnumSeats - the number of seats available.
public java.lang.String toString(java.lang.String[] names)
toString in class VotingSystemnames - The names of the choices.
public java.lang.String getDebugText(java.lang.String[] names)
VotingSystem
getDebugText in class VotingSystemnames - Symbolic names for the choices makes human debugging easier. May be null.
VotingSystem.debugpublic java.lang.String htmlSummary(java.lang.String[] names)
htmlSummary in class VotingSystemnames - The names of the choices. May be null.
public java.lang.String name()
VotingSystem
name in class VotingSystem
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||