Package com.heatonresearch.aifh.genetic.mutate

Examples of com.heatonresearch.aifh.genetic.mutate.MutatePerturb


                return false;
            }
        });


        MutatePerturb opp = new MutatePerturb(0.1);
        train.addOperation(1.0, opp);


        // Create a peterb operator.  Use it 1.0 (100%) of the time.
        DoubleArrayGenome[] parents = new DoubleArrayGenome[1];
        parents[0] = (DoubleArrayGenome) pop.getGenomeFactory().factor();
        parents[0].setPopulation(pop);

        for (int i = 1; i <= 5; i++) {
            parents[0].getData()[i - 1] = i;
        }

        // Create an array to hold the offspring.
        DoubleArrayGenome[] offspring = new DoubleArrayGenome[1];
        offspring[0] = new DoubleArrayGenome(5);

        // Perform the operation
        opp.performOperation(rnd, parents, 0, offspring, 0);

        // Display the results
        System.out.println("Parent: " + Arrays.toString(parents[0].getData()));
        System.out.println("Offspring: " + Arrays.toString(offspring[0].getData()));
View Full Code Here


            BasicEA genetic = new BasicEA(pop, score);
            genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 5));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);

            RBFNetwork winner = (RBFNetwork) codec.decode(genetic.getBestGenome());
View Full Code Here

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 3));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);

            RBFNetwork winner = (RBFNetwork) codec.decode(genetic.getBestGenome());
View Full Code Here

        this.genetic = new BasicEA(pop, score);

        this.genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());

        genetic.addOperation(0.9, new Splice(PlantUniverse.GENOME_SIZE / 3));
        genetic.addOperation(0.1, new MutatePerturb(0.1));

        // Display

        this.universe = new PlantUniverse();
        this.universe.reset();
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.genetic.mutate.MutatePerturb

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.