Examples of shouldTerminate()


Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        // Best doesn't improve even though mean does.
        data = new PopulationData<Object>(new Object(), 2.2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        // Best doesn't improve even though mean does.
        data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 2, 3);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
    }


    @Test
    public void testPopulationMeanStagnation()
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

    @Test
    public void testPopulationMeanStagnation()
    {
        TerminationCondition stagnation = new Stagnation(2, true, true);
        PopulationData<Object> data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 0, 1);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 2, 3);
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        TerminationCondition stagnation = new Stagnation(2, true, true);
        PopulationData<Object> data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 0, 1);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
        data = new PopulationData<Object>(new Object(), 2.1, 1.5, 0.1, true, 10, 0, 3, 4);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        data = new PopulationData<Object>(new Object(), 2.2, 1.5, 0.1, true, 10, 0, 4, 4);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
        data = new PopulationData<Object>(new Object(), 2.1, 1.5, 0.1, true, 10, 0, 3, 4);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        data = new PopulationData<Object>(new Object(), 2.2, 1.5, 0.1, true, 10, 0, 4, 4);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
    }

View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
        data = new PopulationData<Object>(new Object(), 2.1, 1.5, 0.1, true, 10, 0, 3, 4);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        data = new PopulationData<Object>(new Object(), 2.2, 1.5, 0.1, true, 10, 0, 4, 4);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
    }


    @Test
    public void testPopulationMeanStagnationNonNatural()
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

    @Test
    public void testPopulationMeanStagnationNonNatural()
    {
        TerminationCondition stagnation = new Stagnation(2, false, true);
        PopulationData<Object> data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 0, 1);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 2, 3);
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        TerminationCondition stagnation = new Stagnation(2, false, true);
        PopulationData<Object> data = new PopulationData<Object>(new Object(), 2, 1.5, 0.1, true, 10, 0, 0, 1);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        data = new PopulationData<Object>(new Object(), 2, 1.2, 0.1, true, 10, 0, 1, 2);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Best doesn't improve but mean does.
        data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
        data = new PopulationData<Object>(new Object(), 2.1, 1.6, 0.1, true, 10, 0, 3, 4);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        data = new PopulationData<Object>(new Object(), 2.2, 1.5, 0.1, true, 10, 0, 4, 4);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
View Full Code Here

Examples of org.uncommons.watchmaker.framework.TerminationCondition.shouldTerminate()

        data = new PopulationData<Object>(new Object(), 2, 1, 0.1, true, 10, 0, 2, 3);
        // Best has stagnated but mean hasn't so shouldn't terminate.
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 2 more generations.";
        // Now we let the mean stagnate...and let the best candidate get fitter...
        data = new PopulationData<Object>(new Object(), 2.1, 1.6, 0.1, true, 10, 0, 3, 4);
        assert !stagnation.shouldTerminate(data) : "Stagnation should not be triggered for at least 1 more generation.";
        data = new PopulationData<Object>(new Object(), 2.2, 1.5, 0.1, true, 10, 0, 4, 4);
        assert stagnation.shouldTerminate(data) : "Stagnation should be triggered after 2 generations without improvement.";
    }
}
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.