Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.drools.planner.core.constructionheuristic.greedyFit.decider;
 
 
 public class DefaultGreedyDecider implements GreedyDecider {
 
    protected boolean assertMoveScoreIsUncorrupted = false;
    public void setPlanningVariableWalker(PlanningVariableWalker planningVariableWalker) {
        this. = planningVariableWalker;
    }
            ConstructionHeuristicPickEarlyType constructionHeuristicPickEarlyType) {
        this. = constructionHeuristicPickEarlyType;
    }
    public void setAssertMoveScoreIsUncorrupted(boolean assertMoveScoreIsUncorrupted) {
        this. = assertMoveScoreIsUncorrupted;
    }
    // ************************************************************************
    // Worker methods
    // ************************************************************************
    public void phaseStarted(GreedyFitSolverPhaseScope greedyFitSolverPhaseScope) {
        .phaseStarted(greedyFitSolverPhaseScope);
    }
    public void beforeDeciding(GreedyFitStepScope greedyFitStepScope) {
        .beforeDeciding(greedyFitStepScope);
    }
    public void decideNextStep(GreedyFitStepScope greedyFitStepScope) {
        GreedyFitSolverPhaseScope greedyFitSolverPhaseScope = greedyFitStepScope.getGreedyFitSolverPhaseScope();
        .initWalk(greedyFitStepScope.getPlanningEntity());
        Score lastStepScore = greedyFitSolverPhaseScope.getLastCompletedStepScope().getScore();
        Score maxScore = greedyFitSolverPhaseScope.getScoreDefinition().getPerfectMinimumScore();
        while (.hasWalk()) {
            .walk();
            Score score = greedyFitSolverPhaseScope.calculateScoreFromWorkingMemory();
            if () {
                greedyFitSolverPhaseScope.assertWorkingScore(score);
            }
            if (score.compareTo(maxScore) > 0) {
                greedyFitStepScope.setVariableToValueMap(.getVariableToValueMap());
                maxScore = score;
            }
            if (
                    && lastStepScore != null
                    && score.compareTo(lastStepScore) >= 0) {
                break;
            }
        }
        greedyFitStepScope.setScore(maxScore);
    }
    public void stepDecided(GreedyFitStepScope greedyFitStepScope) {
        .stepDecided(greedyFitStepScope);
    }
    public void stepTaken(GreedyFitStepScope greedyFitStepScope) {
        .stepTaken(greedyFitStepScope);
    }
    public void phaseEnded(GreedyFitSolverPhaseScope greedyFitSolverPhaseScope) {
        .phaseEnded(greedyFitSolverPhaseScope);
    }
New to GrepCode? Check out our FAQ X