optaplanner-core/src/main/java/org/optaplanner/core/config/localsearch/LocalSearchPhaseConfig.java
@Override
    public LocalSearchPhase buildPhase(int phaseIndex, HeuristicConfigPolicy solverConfigPolicy,
            BestSolutionRecaller bestSolutionRecaller, Termination solverTermination) {
        HeuristicConfigPolicy phaseConfigPolicy = solverConfigPolicy.createPhaseConfigPolicy();
        DefaultLocalSearchPhase phase = new DefaultLocalSearchPhase(
                phaseIndex, solverConfigPolicy.getLogIndentation(), bestSolutionRecaller,
                buildPhaseTermination(phaseConfigPolicy, solverTermination));
        phase.setDecider(buildDecider(phaseConfigPolicy,
                phase.getTermination()));
        EnvironmentMode environmentMode = phaseConfigPolicy.getEnvironmentMode();
        if (environmentMode.isNonIntrusiveFullAsserted()) {
            phase.setAssertStepScoreFromScratch(true);
        }
        if (environmentMode.isIntrusiveFastAsserted()) {
            phase.setAssertExpectedStepScore(true);
            phase.setAssertShadowVariablesAreNotStaleAfterStep(true);
        }
        return phase;
    }
@Override
    public LocalSearchPhase buildPhase(int phaseIndex, HeuristicConfigPolicy solverConfigPolicy,
            BestSolutionRecaller bestSolutionRecaller, Termination solverTermination) {
        HeuristicConfigPolicy phaseConfigPolicy = solverConfigPolicy.createPhaseConfigPolicy();
        DefaultLocalSearchPhase phase = new DefaultLocalSearchPhase(
                phaseIndex, solverConfigPolicy.getLogIndentation(), bestSolutionRecaller,
                buildPhaseTermination(phaseConfigPolicy, solverTermination));
        phase.setDecider(buildDecider(phaseConfigPolicy,
                phase.getTermination()));
        EnvironmentMode environmentMode = phaseConfigPolicy.getEnvironmentMode();
        if (environmentMode.isNonIntrusiveFullAsserted()) {
            phase.setAssertStepScoreFromScratch(true);
        }
        if (environmentMode.isIntrusiveFastAsserted()) {
            phase.setAssertExpectedStepScore(true);
            phase.setAssertShadowVariablesAreNotStaleAfterStep(true);
        }
        return phase;
    }
@ Override public LocalSearchPhase buildPhase ( int phaseIndex , HeuristicConfigPolicy solverConfigPolicy , BestSolutionRecaller bestSolutionRecaller , Termination solverTermination ) { HeuristicConfigPolicy phaseConfigPolicy = solverConfigPolicy . createPhaseConfigPolicy ( ) ; DefaultLocalSearchPhase phase = new DefaultLocalSearchPhase ( phaseIndex , solverConfigPolicy . getLogIndentation ( ) , bestSolutionRecaller , buildPhaseTermination ( phaseConfigPolicy , solverTermination ) ) ; phase . setDecider ( buildDecider ( phaseConfigPolicy , phase . getTermination ( ) ) ) ; EnvironmentMode environmentMode = phaseConfigPolicy . getEnvironmentMode ( ) ; if ( environmentMode . isNonIntrusiveFullAsserted ( ) ) { phase . setAssertStepScoreFromScratch ( true ) ; } if ( environmentMode . isIntrusiveFastAsserted ( ) ) { phase . setAssertExpectedStepScore ( true ) ; phase . setAssertShadowVariablesAreNotStaleAfterStep ( true ) ; } return phase ; }
************************************************************************
************************************************************************