Examples of StubIntegerFactory


Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

public class EvolutionStrategyEngineTest
{
    @Test
    public void testOnePlusOneEvolutionStrategy()
    {
        EvolutionStrategyEngine<Integer> engine = new EvolutionStrategyEngine<Integer>(new StubIntegerFactory(),
                                                                                       new IntegerAdjuster(-1),
                                                                                       new IntegerEvaluator(),
                                                                                       true,
                                                                                       1,
                                                                                       FrameworkTestUtils.getRNG());
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory


    @Test
    public void testOneCommaOneEvolutionStrategy()
    {
        EvolutionStrategyEngine<Integer> engine = new EvolutionStrategyEngine<Integer>(new StubIntegerFactory(),
                                                                                       new IntegerAdjuster(-1),
                                                                                       new IntegerEvaluator(),
                                                                                       false,
                                                                                       1,
                                                                                       FrameworkTestUtils.getRNG());
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory


    @BeforeMethod
    public void prepareEngine()
    {
        this.engine = new GenerationalEvolutionEngine<Integer>(new StubIntegerFactory(),
                                                               new IntegerZeroMaker(),
                                                               new IntegerEvaluator(),
                                                               new RouletteWheelSelection(),
                                                               FrameworkTestUtils.getRNG());
    }
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

     * A single iteration should update only a single candidate.
     */
    @Test
    public void testIncrementalEvolution()
    {
        SteadyStateEvolutionEngine<Integer> steadyState = new SteadyStateEvolutionEngine<Integer>(new StubIntegerFactory(),
                                                                                                  new IntegerAdjuster(5),
                                                                                                  new NullFitnessEvaluator(),
                                                                                                  new RouletteWheelSelection(),
                                                                                                  1,
                                                                                                  true,
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

        final int epochCount = 2;
        final int generationCount = 5;

        IslandEvolution<Integer> islandEvolution = new IslandEvolution<Integer>(islandCount,
                                                                                new RingMigration(),
                                                                                new StubIntegerFactory(),
                                                                                new IntegerAdjuster(2),
                                                                                new DummyFitnessEvaluator(),
                                                                                new RouletteWheelSelection(),
                                                                                FrameworkTestUtils.getRNG());
        final int[] observedEpochCount = new int[1];
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

     * replaced if the forceSingleUpdate flag is set.
     */
    @Test
    public void testForcedSingleCandidateUpdate()
    {
        SteadyStateEvolutionEngine<Integer> steadyState = new SteadyStateEvolutionEngine<Integer>(new StubIntegerFactory(),
                                                                                                  new IntegerAdjuster(5),
                                                                                                  new NullFitnessEvaluator(),
                                                                                                  new RouletteWheelSelection(),
                                                                                                  2,
                                                                                                  true, // Force single update.
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

    @Test
    public void testInterrupt()
    {
        IslandEvolution<Integer> islandEvolution = new IslandEvolution<Integer>(2,
                                                                                new RingMigration(),
                                                                                new StubIntegerFactory(),
                                                                                new IntegerAdjuster(2),
                                                                                new DummyFitnessEvaluator(),
                                                                                new RouletteWheelSelection(),
                                                                                FrameworkTestUtils.getRNG());
        final long timeout = 1000L;
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory

    @Test(expectedExceptions = IllegalStateException.class)
    public void testGetSatisfiedTerminationConditionsBeforeStart()
    {
        IslandEvolution<Integer> islandEvolution = new IslandEvolution<Integer>(3,
                                                                                new RingMigration(),
                                                                                new StubIntegerFactory(),
                                                                                new IntegerAdjuster(2),
                                                                                new DummyFitnessEvaluator(),
                                                                                new RouletteWheelSelection(),
                                                                                FrameworkTestUtils.getRNG());
        // Should throw an IllegalStateException because evolution hasn't started, let alone terminated.
View Full Code Here

Examples of org.uncommons.watchmaker.framework.factories.StubIntegerFactory


    @Test
    public void testElitism()
    {
        SteadyStateEvolutionEngine<Integer> steadyState = new SteadyStateEvolutionEngine<Integer>(new StubIntegerFactory(),
                                                                                                  new IntegerAdjuster(10),
                                                                                                  new NullFitnessEvaluator(),
                                                                                                  new RouletteWheelSelection(),
                                                                                                  1,
                                                                                                  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.