Package org.optaplanner.benchmark.impl.result

Examples of org.optaplanner.benchmark.impl.result.SingleBenchmarkResult


public abstract class AbstractSolverRankingComparatorTest {

    protected void addSingleBenchmark(List<SingleBenchmarkResult> singleBenchmarkResultList,
            int score, int bestScore, int worstScore) {
        SingleBenchmarkResult singleBenchmarkResult = new SingleBenchmarkResult(null, null);
        SimpleScore scoreObject = SimpleScore.valueOf(score);
        SimpleScore bestScoreObject = SimpleScore.valueOf(bestScore);
        SimpleScore worstScoreObject = SimpleScore.valueOf(worstScore);
        singleBenchmarkResult.setScore(scoreObject);
        singleBenchmarkResult.setWinningScoreDifference(scoreObject.subtract(bestScoreObject));
        singleBenchmarkResult.setWorstScoreDifferencePercentage(
                ScoreDifferencePercentage.calculateScoreDifferencePercentage(worstScoreObject, scoreObject));
        singleBenchmarkResultList.add(singleBenchmarkResult);
    }
View Full Code Here


        singleBenchmarkResultList.add(singleBenchmarkResult);
    }

    protected void addSingleBenchmarkWithHardSoftLongScore(List<SingleBenchmarkResult> singleBenchmarkResultList,
            long hardScore, long softScore, long hardBestScore, long softBestScore, long hardWorstScore, long softWorstScore) {
        SingleBenchmarkResult singleBenchmarkResult = new SingleBenchmarkResult(null, null);
        HardSoftLongScore scoreObject = HardSoftLongScore.valueOf(hardScore, softScore);
        HardSoftLongScore bestScoreObject = HardSoftLongScore.valueOf(hardBestScore, softBestScore);
        HardSoftLongScore worstScoreObject = HardSoftLongScore.valueOf(hardWorstScore, softWorstScore);
        singleBenchmarkResult.setScore(scoreObject);
        singleBenchmarkResult.setWinningScoreDifference(scoreObject.subtract(bestScoreObject));
        singleBenchmarkResult.setWorstScoreDifferencePercentage(
                ScoreDifferencePercentage.calculateScoreDifferencePercentage(worstScoreObject, scoreObject));
        singleBenchmarkResultList.add(singleBenchmarkResult);
    }
View Full Code Here

        return problemBenchmarkResult;
    }

    private void buildSingleBenchmark(
            SolverBenchmarkResult solverBenchmarkResult, ProblemBenchmarkResult problemBenchmarkResult) {
        SingleBenchmarkResult singleBenchmarkResult = new SingleBenchmarkResult(solverBenchmarkResult, problemBenchmarkResult);
        List<PureSingleStatistic> pureSingleStatisticList = new ArrayList<PureSingleStatistic>(
                singleStatisticTypeList == null ? 0 : singleStatisticTypeList.size());
        if (singleStatisticTypeList != null) {
            for (SingleStatisticType singleStatisticType : singleStatisticTypeList) {
                pureSingleStatisticList.add(singleStatisticType.buildPureSingleStatistic(singleBenchmarkResult));
            }
        }
        singleBenchmarkResult.setPureSingleStatisticList(pureSingleStatisticList);
        singleBenchmarkResult.initSingleStatisticMap();
        solverBenchmarkResult.getSingleBenchmarkResultList().add(singleBenchmarkResult);
        problemBenchmarkResult.getSingleBenchmarkResultList().add(singleBenchmarkResult);
    }
View Full Code Here

TOP

Related Classes of org.optaplanner.benchmark.impl.result.SingleBenchmarkResult

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.