Package org.optaplanner.core.impl.localsearch.scope

Examples of org.optaplanner.core.impl.localsearch.scope.LocalSearchMoveScope


        LocalSearchPhaseScope phaseScope = createPhaseScope();
        forager.phaseStarted(phaseScope);
        LocalSearchStepScope stepScope = createStepScope(phaseScope);
        forager.stepStarted(stepScope);
        // Pre conditions
        LocalSearchMoveScope a = createMoveScope(stepScope, SimpleScore.valueOf(-20), false);
        LocalSearchMoveScope b = createMoveScope(stepScope, SimpleScore.valueOf(-1), false);
        LocalSearchMoveScope c = createMoveScope(stepScope, SimpleScore.valueOf(-20), false);
        LocalSearchMoveScope d = createMoveScope(stepScope, SimpleScore.valueOf(-2), false);
        LocalSearchMoveScope e = createMoveScope(stepScope, SimpleScore.valueOf(-300), false);
        // Do stuff
        forager.addMove(a);
        assertFalse(forager.isQuitEarly());
        forager.addMove(b);
        assertFalse(forager.isQuitEarly());
        forager.addMove(c);
        assertFalse(forager.isQuitEarly());
        forager.addMove(d);
        assertFalse(forager.isQuitEarly());
        forager.addMove(e);
        assertFalse(forager.isQuitEarly());
        LocalSearchMoveScope pickedScope = forager.pickMove(stepScope);
        // Post conditions
        assertSame(b, pickedScope);
        forager.phaseEnded(phaseScope);
    }
View Full Code Here


        LocalSearchPhaseScope phaseScope = createPhaseScope();
        forager.phaseStarted(phaseScope);
        LocalSearchStepScope stepScope = createStepScope(phaseScope);
        forager.stepStarted(stepScope);
        // Pre conditions
        LocalSearchMoveScope a = createMoveScope(stepScope, SimpleScore.valueOf(-1), false);
        LocalSearchMoveScope b = createMoveScope(stepScope, SimpleScore.valueOf(-20), true);
        LocalSearchMoveScope c = createMoveScope(stepScope, SimpleScore.valueOf(-300), true);
        LocalSearchMoveScope d = createMoveScope(stepScope, SimpleScore.valueOf(-1), true);
        // Do stuff
        forager.addMove(a);
        assertFalse(forager.isQuitEarly());
        forager.addMove(b);
        assertFalse(forager.isQuitEarly());
        forager.addMove(c);
        assertFalse(forager.isQuitEarly());
        forager.addMove(d);
        assertTrue(forager.isQuitEarly());
        // Post conditions
        LocalSearchMoveScope pickedScope = forager.pickMove(stepScope);
        assertSame(d, pickedScope);
        forager.phaseEnded(phaseScope);
    }
View Full Code Here

        LocalSearchPhaseScope phaseScope = createPhaseScope();
        forager.phaseStarted(phaseScope);
        LocalSearchStepScope stepScope = createStepScope(phaseScope);
        forager.stepStarted(stepScope);
        // Pre conditions
        LocalSearchMoveScope a = createMoveScope(stepScope, SimpleScore.valueOf(-1), false);
        LocalSearchMoveScope b = createMoveScope(stepScope, SimpleScore.valueOf(-300), true);
        LocalSearchMoveScope c = createMoveScope(stepScope, SimpleScore.valueOf(-4000), true);
        LocalSearchMoveScope d = createMoveScope(stepScope, SimpleScore.valueOf(-20), true);
        // Do stuff
        forager.addMove(a);
        assertFalse(forager.isQuitEarly());
        forager.addMove(b);
        assertFalse(forager.isQuitEarly());
        forager.addMove(c);
        assertFalse(forager.isQuitEarly());
        forager.addMove(d);
        assertTrue(forager.isQuitEarly());
        // Post conditions
        LocalSearchMoveScope pickedScope = forager.pickMove(stepScope);
        assertSame(d, pickedScope);
        forager.phaseEnded(phaseScope);
    }
View Full Code Here

        LocalSearchPhaseScope phaseScope = createPhaseScope();
        forager.phaseStarted(phaseScope);
        LocalSearchStepScope stepScope = createStepScope(phaseScope);
        forager.stepStarted(stepScope);
        // Pre conditions
        LocalSearchMoveScope a = createMoveScope(stepScope, SimpleScore.valueOf(-20), false);
        LocalSearchMoveScope b = createMoveScope(stepScope, SimpleScore.valueOf(-1), true);
        LocalSearchMoveScope c = createMoveScope(stepScope, SimpleScore.valueOf(-1), true);
        LocalSearchMoveScope d = createMoveScope(stepScope, SimpleScore.valueOf(-20), true);
        // Do stuff
        forager.addMove(a);
        assertFalse(forager.isQuitEarly());
        forager.addMove(b);
        assertFalse(forager.isQuitEarly());
        forager.addMove(c);
        assertFalse(forager.isQuitEarly());
        forager.addMove(d);
        assertTrue(forager.isQuitEarly());
        // Post conditions
        LocalSearchMoveScope pickedScope = forager.pickMove(stepScope);
        assertSame(b, pickedScope);
        forager.phaseEnded(phaseScope);
    }
View Full Code Here

        LocalSearchStepScope stepScope = new LocalSearchStepScope(phaseScope);
        return stepScope;
    }

    public LocalSearchMoveScope createMoveScope(LocalSearchStepScope stepScope, Score score, boolean accepted) {
        LocalSearchMoveScope moveScope = new LocalSearchMoveScope(stepScope);
        moveScope.setMove(new DummyMove());
        moveScope.setScore(score);
        moveScope.setAccepted(accepted);
        return moveScope;
    }
View Full Code Here

TOP

Related Classes of org.optaplanner.core.impl.localsearch.scope.LocalSearchMoveScope

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.