Examples of shouldTerminate()


Examples of de.mh4j.solver.termination.StagnationTermination.shouldTerminate()

        int maxNrOfStagnatingSteps = 50;
        Solver solver = mock(Solver.class);
        when(solver.getCurrentSolution()).thenReturn(mock(Solution.class));
        TerminationCondition terminator = new StagnationTermination(solver, maxNrOfStagnatingSteps);

        assert terminator.shouldTerminate() == false;

        for (int i = 0; i < maxNrOfStagnatingSteps - 1; i++) {
            assert terminator.shouldTerminate() == false;
        }
View Full Code Here

Examples of de.mh4j.solver.termination.StagnationTermination.shouldTerminate()

        TerminationCondition terminator = new StagnationTermination(solver, maxNrOfStagnatingSteps);

        assert terminator.shouldTerminate() == false;

        for (int i = 0; i < maxNrOfStagnatingSteps - 1; i++) {
            assert terminator.shouldTerminate() == false;
        }

        assert terminator.shouldTerminate() == true : "Terminator should terminate now because we asked it "
                + maxNrOfStagnatingSteps
                + " if we should terminate without any improvement in the associated solver";
View Full Code Here

Examples of de.mh4j.solver.termination.StagnationTermination.shouldTerminate()

        for (int i = 0; i < maxNrOfStagnatingSteps - 1; i++) {
            assert terminator.shouldTerminate() == false;
        }

        assert terminator.shouldTerminate() == true : "Terminator should terminate now because we asked it "
                + maxNrOfStagnatingSteps
                + " if we should terminate without any improvement in the associated solver";
    }

}
View Full Code Here

Examples of de.mh4j.solver.termination.StepCountTermination.shouldTerminate()

        int maxStepCount = 100;
        Solver<Object> solver = mock(Solver.class);
        TerminationCondition terminator = new StepCountTermination(solver, maxStepCount);

        when(solver.getNumberOfSteps()).thenReturn(0);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
View Full Code Here

Examples of de.mh4j.solver.termination.StepCountTermination.shouldTerminate()

        when(solver.getNumberOfSteps()).thenReturn(0);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
        assert terminator.shouldTerminate() == true;

        when(solver.getNumberOfSteps()).thenReturn(1000);
View Full Code Here

Examples of de.mh4j.solver.termination.StepCountTermination.shouldTerminate()

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
        assert terminator.shouldTerminate() == true;

        when(solver.getNumberOfSteps()).thenReturn(1000);
        assert terminator.shouldTerminate() == true;
    }
View Full Code Here

Examples of de.mh4j.solver.termination.StepCountTermination.shouldTerminate()

        when(solver.getNumberOfSteps()).thenReturn(100);
        assert terminator.shouldTerminate() == true;

        when(solver.getNumberOfSteps()).thenReturn(1000);
        assert terminator.shouldTerminate() == true;
    }

}
View Full Code Here

Examples of de.mh4j.solver.termination.TerminationCondition.shouldTerminate()

        int maxStepCount = 100;
        Solver<Object> solver = mock(Solver.class);
        TerminationCondition terminator = new StepCountTermination(solver, maxStepCount);

        when(solver.getNumberOfSteps()).thenReturn(0);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
View Full Code Here

Examples of de.mh4j.solver.termination.TerminationCondition.shouldTerminate()

        when(solver.getNumberOfSteps()).thenReturn(0);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
        assert terminator.shouldTerminate() == true;

        when(solver.getNumberOfSteps()).thenReturn(1000);
View Full Code Here

Examples of de.mh4j.solver.termination.TerminationCondition.shouldTerminate()

        when(solver.getNumberOfSteps()).thenReturn(99);
        assert terminator.shouldTerminate() == false;

        when(solver.getNumberOfSteps()).thenReturn(100);
        assert terminator.shouldTerminate() == true;

        when(solver.getNumberOfSteps()).thenReturn(1000);
        assert terminator.shouldTerminate() == true;
    }
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.