Examples of TreeGenome


Examples of com.heatonresearch.aifh.genetic.trees.TreeGenome

    /**
     * Generate a random path through cities.
     */
    private TreeGenome randomGenome(GenerateRandom rnd, EvaluateExpression eval) {
        TreeGenome result = new TreeGenome(eval);
        result.setRoot(eval.grow(rnd, 5));
        return result;
    }
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.trees.TreeGenome

        Population result = new BasicPopulation(POPULATION_SIZE, null);

        BasicSpecies defaultSpecies = new BasicSpecies();
        defaultSpecies.setPopulation(result);
        for (int i = 0; i < POPULATION_SIZE; i++) {
            final TreeGenome genome = randomGenome(rnd, eval);
            defaultSpecies.add(genome);
        }
        result.setGenomeFactory(new TreeGenomeFactory(eval));
        result.getSpecies().add(defaultSpecies);
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.trees.TreeGenome

            lastSolution = thisSolution;
        }

        System.out.println("Good solution found:");
        TreeGenome best = (TreeGenome) genetic.getBestGenome();
        System.out.println(eval.displayExpressionNormal(best.getRoot()));
        genetic.finishTraining();
    }
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.