Package org.drools.planner.benchmark.core.ranking

Examples of org.drools.planner.benchmark.core.ranking.SingleBenchmarkRankingComparator


        }
        determineRanking(successSingleBenchmarkList);
    }

    private void determineRanking(List<SingleBenchmark> rankedSingleBenchmarkList) {
        Comparator singleBenchmarkRankingComparator = new SingleBenchmarkRankingComparator();
        Collections.sort(rankedSingleBenchmarkList, Collections.reverseOrder(singleBenchmarkRankingComparator));
        int ranking = 0;
        SingleBenchmark previousSingleBenchmark = null;
        int previousSameRankingCount = 0;
        for (SingleBenchmark singleBenchmark : rankedSingleBenchmarkList) {
            if (previousSingleBenchmark != null
                    && singleBenchmarkRankingComparator.compare(previousSingleBenchmark, singleBenchmark) != 0) {
                ranking += previousSameRankingCount;
                previousSameRankingCount = 0;
            }
            singleBenchmark.setRanking(ranking);
            previousSingleBenchmark = singleBenchmark;
View Full Code Here

TOP

Related Classes of org.drools.planner.benchmark.core.ranking.SingleBenchmarkRankingComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.