Examples of doMove()


Examples of org.drools.planner.core.move.Move.doMove()

            }
            logger.info("Step index ({}), time spend ({}) taking step ({}) out of {} accepted moves.",
                    new Object[]{stepScope.getStepIndex(), localSearchSolverScope.calculateTimeMillisSpend(),
                            nextStep, decider.getForager().getAcceptedMovesSize()});
            stepDecided(stepScope);
            nextStep.doMove(stepScope.getWorkingMemory());
            // there is no need to recalculate the score, but we still need to set it
            localSearchSolverScope.getWorkingSolution().setScore(stepScope.getScore());
            if (assertStepScoreIsUncorrupted) {
                localSearchSolverScope.assertWorkingScore(stepScope.getScore());
            }
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        Move move = moveScope.getMove();
        Move undoMove = move.createUndoMove(workingMemory);
        moveScope.setUndoMove(undoMove);
        move.doMove(workingMemory);
        processMove(moveScope);
        undoMove.doMove(workingMemory);
        if (assertUndoMoveIsUncorrupted) {
            Score undoScore = moveScope.getStepScope().getLocalSearchSolverScope().calculateScoreFromWorkingMemory();
            Score lastCompletedStepScore = moveScope.getStepScope().getLocalSearchSolverScope()
                    .getLastCompletedStepScope().getScore();
            if (!undoScore.equals(lastCompletedStepScore)) {
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector).beforeVariableChanged(a3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(a3, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(a2, "chainedObject");
        verify(scoreDirector).afterVariableChanged(a2, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
    }

}
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector, atLeastOnce()).beforeVariableChanged(b2, "chainedObject");
        verify(scoreDirector, atLeastOnce()).afterVariableChanged(b2, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(b3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b3, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
        SelectorTestUtils.assertChain(b0, b1, b2, b3);
    }

    @Test
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector).beforeVariableChanged(b2, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b2, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(b3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b3, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
        SelectorTestUtils.assertChain(b0, b1, b2, b3);
    }

}
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        SelectorTestUtils.assertChain(b0, b1, a3);

        verify(scoreDirector).beforeVariableChanged(a3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(a3, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3);
        SelectorTestUtils.assertChain(b0, b1);
    }

    @Test
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector).beforeVariableChanged(a3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(a3, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(b1, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b1, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3);
        SelectorTestUtils.assertChain(b0, b1);
    }

}
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector, atLeastOnce()).beforeVariableChanged(b2, "chainedObject");
        verify(scoreDirector, atLeastOnce()).afterVariableChanged(b2, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(b3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b3, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
        SelectorTestUtils.assertChain(b0, b1, b2, b3);
    }

    @Test
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector, atLeastOnce()).beforeVariableChanged(a6, "chainedObject");
        verify(scoreDirector, atLeastOnce()).afterVariableChanged(a6, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(a7, "chainedObject");
        verify(scoreDirector).afterVariableChanged(a7, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5, a6, a7);
    }

    @Test
    public void oldAndNewTrailing() {
View Full Code Here

Examples of org.drools.planner.core.move.Move.doMove()

        verify(scoreDirector).beforeVariableChanged(b2, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b2, "chainedObject");
        verify(scoreDirector).beforeVariableChanged(b3, "chainedObject");
        verify(scoreDirector).afterVariableChanged(b3, "chainedObject");

        undoMove.doMove(scoreDirector);
        SelectorTestUtils.assertChain(a0, a1, a2, a3, a4, a5);
        SelectorTestUtils.assertChain(b0, b1, b2, b3);
    }

    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.