Package org.drools.planner.core.solver

Examples of org.drools.planner.core.solver.AbstractSolverScope


        abstractSolverScope.setBestScore(initialScore);
        solverEventSupport.fireBestSolutionChanged(newBestSolution); // TODO if solution is initialized it should not fire an event
    }

    public void stepTaken(AbstractStepScope abstractStepScope) {
        AbstractSolverScope abstractSolverScope = abstractStepScope.getAbstractSolverScope();
        Score newScore = abstractStepScope.getScore();
        Score bestScore = abstractSolverScope.getBestScore();
        boolean bestScoreImproved = newScore.compareTo(bestScore) > 0;
        abstractStepScope.setBestScoreImproved(bestScoreImproved);
        if (bestScoreImproved) {
            abstractSolverScope.setBestSolutionStepIndex(abstractStepScope.getStepIndex());
            Solution newBestSolution = abstractStepScope.createOrGetClonedSolution();
            abstractSolverScope.setBestSolution(newBestSolution);
            abstractSolverScope.setBestScore(newBestSolution.getScore());
            solverEventSupport.fireBestSolutionChanged(newBestSolution);
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.planner.core.solver.AbstractSolverScope

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.