Package org.drools.planner.core.constructionheuristic.greedyFit

Examples of org.drools.planner.core.constructionheuristic.greedyFit.GreedyFitSolverPhaseScope


    public void beforeDeciding(GreedyFitStepScope greedyFitStepScope) {
        planningVariableWalker.beforeDeciding(greedyFitStepScope);
    }

    public void decideNextStep(GreedyFitStepScope greedyFitStepScope) {
        GreedyFitSolverPhaseScope greedyFitSolverPhaseScope = greedyFitStepScope.getGreedyFitSolverPhaseScope();
        planningVariableWalker.initWalk(greedyFitStepScope.getPlanningEntity());
        Score lastStepScore = greedyFitSolverPhaseScope.getLastCompletedStepScope().getScore();
        Score maxScore = greedyFitSolverPhaseScope.getScoreDefinition().getPerfectMinimumScore();
        while (planningVariableWalker.hasWalk()) {
            planningVariableWalker.walk();
            Score score = greedyFitSolverPhaseScope.calculateScoreFromWorkingMemory();
            if (assertMoveScoreIsUncorrupted) {
                greedyFitSolverPhaseScope.assertWorkingScore(score);
            }
            if (score.compareTo(maxScore) > 0) {
                greedyFitStepScope.setVariableToValueMap(planningVariableWalker.getVariableToValueMap());
                maxScore = score;
            }
View Full Code Here


        moveScope.setUndoMove(undoMove);
        move.doMove(scoreDirector);
        processMove(moveScope);
        undoMove.doMove(scoreDirector);
        if (assertUndoMoveIsUncorrupted) {
            GreedyFitSolverPhaseScope greedyFitSolverPhaseScope = moveScope.getGreedyFitStepScope()
                    .getGreedyFitSolverPhaseScope();
            Score undoScore = greedyFitSolverPhaseScope.calculateScore();
            Score lastCompletedStepScore = greedyFitSolverPhaseScope.getLastCompletedStepScope().getScore();
            if (!undoScore.equals(lastCompletedStepScore)) {
                // First assert that are probably no corrupted score rules.
                greedyFitSolverPhaseScope.getSolverScope().getScoreDirector()
                        .assertWorkingScore(undoScore);
                throw new IllegalStateException(
                        "The moveClass (" + move.getClass() + ")'s move (" + move
                                + ") probably has a corrupted undoMove (" + undoMove + ")." +
                                " Or maybe there are corrupted score rules.\n"
View Full Code Here

    public void beforeDeciding(GreedyFitStepScope greedyFitStepScope) {
        planningVariableWalker.beforeDeciding(greedyFitStepScope);
    }

    public void decideNextStep(GreedyFitStepScope greedyFitStepScope) {
        GreedyFitSolverPhaseScope greedyFitSolverPhaseScope = greedyFitStepScope.getGreedyFitSolverPhaseScope();
        planningVariableWalker.initWalk(greedyFitStepScope.getPlanningEntity());
        Score lastStepScore = greedyFitSolverPhaseScope.getLastCompletedStepScope().getScore();
        Score maxScore = greedyFitSolverPhaseScope.getScoreDefinition().getPerfectMinimumScore();
        while (planningVariableWalker.hasWalk()) {
            planningVariableWalker.walk();
            Score score = greedyFitSolverPhaseScope.calculateScoreFromWorkingMemory();
            if (assertMoveScoreIsUncorrupted) {
                greedyFitSolverPhaseScope.assertWorkingScore(score);
            }
            if (score.compareTo(maxScore) > 0) {
                greedyFitStepScope.setVariableToValueMap(planningVariableWalker.getVariableToValueMap());
                maxScore = score;
            }
View Full Code Here

TOP

Related Classes of org.drools.planner.core.constructionheuristic.greedyFit.GreedyFitSolverPhaseScope

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.