(List<? extends RankResult<?>> ranking, double absThreshold, double relThreshold, double maxScore)
| 722 | } |
| 723 | |
| 724 | public static boolean checkRank(List<? extends RankResult<?>> ranking, double absThreshold, double relThreshold, double maxScore) { |
| 725 | if (ranking.isEmpty()) return false; |
| 726 | |
| 727 | double score = getScore(ranking.get(0).getScore(), maxScore); |
| 728 | if (score < absThreshold) return false; |
| 729 | |
| 730 | if (ranking.size() == 1) { |
| 731 | return true; |
| 732 | } else { |
| 733 | double nextScore = getScore(ranking.get(1).getScore(), maxScore); |
| 734 | |
| 735 | return nextScore < score * (1 - relThreshold); |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | public static double getScore(double rawScore, double maxScore) { |
| 740 | double ret = rawScore / maxScore; |
no test coverage detected