fixed overall score calculation
This commit is contained in:
parent
3320977a12
commit
811eb582b8
|
|
@ -103,12 +103,12 @@ public abstract class Competitor {
|
||||||
public double getOverallScore() {
|
public double getOverallScore() {
|
||||||
double output = 0;
|
double output = 0;
|
||||||
for (int score: getScores()) {
|
for (int score: getScores()) {
|
||||||
output += Math.log(score); //get the sum of the natural log of the scores
|
if (Math.log(score) != Double.NEGATIVE_INFINITY) {
|
||||||
|
output += Math.log(score); //get the sum of the natural log of the scores
|
||||||
|
}
|
||||||
}
|
}
|
||||||
output /= 1.93; //divide the sum by 1.93
|
output /= 1.93; //divide the sum by 1.93
|
||||||
if (output == Double.NEGATIVE_INFINITY) {
|
|
||||||
output = 0;
|
|
||||||
}
|
|
||||||
return Double.parseDouble(df.format(output)); //df.format() allows the scores to be formatted to 2 decimal places
|
return Double.parseDouble(df.format(output)); //df.format() allows the scores to be formatted to 2 decimal places
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue