Package org.drools.planner.core.score.definition

Examples of org.drools.planner.core.score.definition.ScoreDefinition


        NumberAxis yAxis = new NumberAxis("Average calculate count per second");
        XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
        int seriesIndex = 0;
        for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
            XYSeries series = new XYSeries(solverBenchmark.getName());
            ScoreDefinition scoreDefinition = solverBenchmark.getSolverConfig().getScoreDefinitionConfig()
                    .buildScoreDefinition();
            for (PlannerBenchmarkResult result : solverBenchmark.getPlannerBenchmarkResultList()) {
                long problemScale = result.getProblemScale();
                long averageCalculateCountPerSecond = result.getAverageCalculateCountPerSecond();
                series.add((Long) problemScale, (Long) averageCalculateCountPerSecond);
View Full Code Here


        }
        SolutionDescriptor solutionDescriptor = buildSolutionDescriptor();
        ScoreDirectorFactory scoreDirectorFactory = scoreDirectorFactoryConfig.buildScoreDirectorFactory(
                solutionDescriptor);
        solver.setScoreDirectorFactory(scoreDirectorFactory);
        ScoreDefinition scoreDefinition = scoreDirectorFactory.getScoreDefinition();
        Termination termination = terminationConfig.buildTermination(scoreDefinition, basicPlumbingTermination);
        solver.setTermination(termination);
        BestSolutionRecaller bestSolutionRecaller = new BestSolutionRecaller();
        solver.setBestSolutionRecaller(bestSolutionRecaller);
        if (solverPhaseConfigList == null || solverPhaseConfigList.isEmpty()) {
View Full Code Here

    // ************************************************************************
    // Builder methods
    // ************************************************************************

    public ScoreDirectorFactory buildScoreDirectorFactory(SolutionDescriptor solutionDescriptor) {
        ScoreDefinition scoreDefinition = buildScoreDefinition();
        AbstractScoreDirectorFactory scoreDirectorFactory;
        // TODO this should fail-fast if multiple scoreDirectorFactory's are configured
        scoreDirectorFactory = buildSimpleScoreDirectorFactory();
        if (scoreDirectorFactory == null) {
            scoreDirectorFactory = buildIncrementalScoreDirectorFactory();
View Full Code Here

    }

    private CharSequence writeBestScoreSummaryChart(List<SolverBenchmark> solverBenchmarkList) {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
            ScoreDefinition scoreDefinition = solverBenchmark.getSolverConfig().getScoreDirectorFactoryConfig()
                    .buildScoreDefinition();
            for (PlannerBenchmarkResult result : solverBenchmark.getPlannerBenchmarkResultList()) {
                Score score = result.getScore();
                Double scoreGraphValue = scoreDefinition.translateScoreToGraphValue(score);
                String solverLabel = solverBenchmark.getName();
                if (solverBenchmark.isRankingBest()) {
                    solverLabel += " (winner)";
                }
                String planningProblemLabel = result.getProblemBenchmark().getName();
View Full Code Here

    }

    private CharSequence writeWinningScoreDifferenceSummaryChart(List<SolverBenchmark> solverBenchmarkList) {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
            ScoreDefinition scoreDefinition = solverBenchmark.getSolverConfig().getScoreDirectorFactoryConfig()
                    .buildScoreDefinition();
            for (PlannerBenchmarkResult result : solverBenchmark.getPlannerBenchmarkResultList()) {
                Score score = result.getWinningScoreDifference();
                Double scoreGraphValue = scoreDefinition.translateScoreToGraphValue(score);
                String solverLabel = solverBenchmark.getName();
                if (solverBenchmark.isRankingBest()) {
                    solverLabel += " (winner)";
                }
                String planningProblemLabel = result.getProblemBenchmark().getName();
View Full Code Here

        }
        configNameList.add(configName);
        BestScoreStatisticListener bestScoreStatisticListener = new BestScoreStatisticListener();
        solver.addEventListener(bestScoreStatisticListener);
        bestScoreStatisticListenerMap.put(configName, bestScoreStatisticListener);
        ScoreDefinition newScoreDefinition = solver.getScoreDirectorFactory().getScoreDefinition();
        if (scoreDefinition == null) {
            scoreDefinition = newScoreDefinition;
        } else {
            if (!scoreDefinition.getClass().equals(newScoreDefinition.getClass())) {
                throw new IllegalStateException("The new scoreDefinition (" + newScoreDefinition
                        + ") should be of the same class as the other scoreDefinition (" + scoreDefinition + ")");
            }
        }
    }
View Full Code Here

        }
        SolutionDescriptor solutionDescriptor = buildSolutionDescriptor();
        DefaultSolutionDirector solutionDirector = new DefaultSolutionDirector();
        solutionDirector.setSolutionDescriptor(solutionDescriptor);
        solutionDirector.setRuleBase(buildRuleBase());
        ScoreDefinition scoreDefinition = scoreDefinitionConfig.buildScoreDefinition();
        solutionDirector.setScoreDefinition(scoreDefinition);
        solver.setSolutionDirector(solutionDirector);
        Termination termination = terminationConfig.buildTermination(scoreDefinition, basicPlumbingTermination);
        solver.setTermination(termination);
        BestSolutionRecaller bestSolutionRecaller = new BestSolutionRecaller();
View Full Code Here

    }

    private CharSequence writeBestScoreSummaryChart() {
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
            ScoreDefinition scoreDefinition = solverBenchmark.getSolverConfig().getScoreDefinitionConfig()
                    .buildScoreDefinition();
            for (SolverBenchmarkResult result : solverBenchmark.getSolverBenchmarkResultList()) {
                Score score = result.getScore();
                Double scoreGraphValue = scoreDefinition.translateScoreToGraphValue(score);
                String solverLabel = solverBenchmark.getName();
                if (solverBenchmark.getRanking() == 0) {
                    solverLabel += " (winner)";
                }
                dataset.addValue(scoreGraphValue, solverLabel, result.getUnsolvedSolutionFile().getName());
View Full Code Here

        yAxis.setNumberFormatOverride(new MillisecondsSpendNumberFormat());
        XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
        int seriesIndex = 0;
        for (SolverBenchmark solverBenchmark : solverBenchmarkList) {
            XYSeries series = new XYSeries(solverBenchmark.getName());
            ScoreDefinition scoreDefinition = solverBenchmark.getSolverConfig().getScoreDefinitionConfig()
                    .buildScoreDefinition();
            for (SolverBenchmarkResult result : solverBenchmark.getSolverBenchmarkResultList()) {
                Long timeMillisSpend = result.getTimeMillisSpend();
                Score score = result.getScore();
                Double scoreGraphValue = scoreDefinition.translateScoreToGraphValue(score);
                if (scoreGraphValue != null) {
                    series.add(scoreGraphValue, timeMillisSpend);
                }
            }
            XYSeriesCollection seriesCollection = new XYSeriesCollection();
View Full Code Here

TOP

Related Classes of org.drools.planner.core.score.definition.ScoreDefinition

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.