Examples of ScoreDifferencePercentage


Examples of org.drools.planner.benchmark.core.measurement.ScoreDifferencePercentage

    protected void determineTotalsAndAverages() {
        failureCount = 0;
        boolean firstNonFailure = true;
        totalScore = null;
        totalWinningScoreDifference = null;
        ScoreDifferencePercentage totalWorstScoreDifferencePercentage = null;
        long totalAverageCalculateCountPerSecond = 0L;
        for (SingleBenchmark singleBenchmark : singleBenchmarkList) {
            if (singleBenchmark.isFailure()) {
                failureCount++;
            } else {
                if (firstNonFailure) {
                    totalScore = singleBenchmark.getScore();
                    totalWinningScoreDifference = singleBenchmark.getWinningScoreDifference();
                    totalWorstScoreDifferencePercentage = singleBenchmark.getWorstScoreDifferencePercentage();
                    totalAverageCalculateCountPerSecond = singleBenchmark.getAverageCalculateCountPerSecond();
                    firstNonFailure = false;
                } else {
                    totalScore = totalScore.add(singleBenchmark.getScore());
                    totalWinningScoreDifference = totalWinningScoreDifference.add(
                            singleBenchmark.getWinningScoreDifference());
                    totalWorstScoreDifferencePercentage = totalWorstScoreDifferencePercentage.add(
                            singleBenchmark.getWorstScoreDifferencePercentage());
                    totalAverageCalculateCountPerSecond += singleBenchmark.getAverageCalculateCountPerSecond();
                }
            }
        }
        if (!firstNonFailure) {
            int successCount = getSuccessCount();
            averageWorstScoreDifferencePercentage = totalWorstScoreDifferencePercentage.divide((double) successCount);
            averageAverageCalculateCountPerSecond = totalAverageCalculateCountPerSecond / (long) successCount;
        }
    }
View Full Code Here

Examples of org.optaplanner.benchmark.impl.measurement.ScoreDifferencePercentage

    protected void determineTotalsAndAverages() {
        failureCount = 0;
        boolean firstNonFailure = true;
        totalScore = null;
        totalWinningScoreDifference = null;
        ScoreDifferencePercentage totalWorstScoreDifferencePercentage = null;
        long totalAverageCalculateCountPerSecond = 0L;
        long totalTimeMillisSpent = 0L;
        for (SingleBenchmarkResult singleBenchmarkResult : singleBenchmarkResultList) {
            if (singleBenchmarkResult.isFailure()) {
                failureCount++;
            } else {
                if (firstNonFailure) {
                    totalScore = singleBenchmarkResult.getScore();
                    totalWinningScoreDifference = singleBenchmarkResult.getWinningScoreDifference();
                    totalWorstScoreDifferencePercentage = singleBenchmarkResult.getWorstScoreDifferencePercentage();
                    totalAverageCalculateCountPerSecond = singleBenchmarkResult.getAverageCalculateCountPerSecond();
                    totalTimeMillisSpent = singleBenchmarkResult.getTimeMillisSpent();
                    firstNonFailure = false;
                } else {
                    totalScore = totalScore.add(singleBenchmarkResult.getScore());
                    totalWinningScoreDifference = totalWinningScoreDifference.add(
                            singleBenchmarkResult.getWinningScoreDifference());
                    totalWorstScoreDifferencePercentage = totalWorstScoreDifferencePercentage.add(
                            singleBenchmarkResult.getWorstScoreDifferencePercentage());
                    totalAverageCalculateCountPerSecond += singleBenchmarkResult.getAverageCalculateCountPerSecond();
                    totalTimeMillisSpent += singleBenchmarkResult.getTimeMillisSpent();
                }
            }
        }
        if (!firstNonFailure) {
            int successCount = getSuccessCount();
            averageScore = totalScore.divide(successCount);
            averageWorstScoreDifferencePercentage = totalWorstScoreDifferencePercentage.divide((double) successCount);
            averageAverageCalculateCountPerSecond = totalAverageCalculateCountPerSecond / (long) successCount;
            averageTimeMillisSpent = totalTimeMillisSpent / (long) successCount;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.