Package com.heatonresearch.aifh.evolutionary.species

Examples of com.heatonresearch.aifh.evolutionary.species.BasicSpecies


     * @return The random population.
     */
    private Population initPopulation() {
        Population result = new BasicPopulation(POPULATION_SIZE, null);

        BasicSpecies defaultSpecies = new BasicSpecies();
        defaultSpecies.setPopulation(result);
        for (int i = 0; i < POPULATION_SIZE; i++) {
            final IntegerArrayGenome genome = randomGenome();
            defaultSpecies.add(genome);
        }
        result.setGenomeFactory(new IntegerArrayGenomeFactory(cities.length));
        result.getSpecies().add(defaultSpecies);

        return result;
View Full Code Here


        final RBFNetwork network = new RBFNetwork(codec.getInputCount(), codec.getRbfCount(), codec.getOutputCount());
        int size = network.getLongTermMemory().length;

        // Create a new population, use a single species.
        Population result = new BasicPopulation(POPULATION_SIZE, new DoubleArrayGenomeFactory(size));
        BasicSpecies defaultSpecies = new BasicSpecies();
        defaultSpecies.setPopulation(result);
        result.getSpecies().add(defaultSpecies);

        // Create a new population of random networks.
        for (int i = 0; i < POPULATION_SIZE; i++) {
            final DoubleArrayGenome genome = new DoubleArrayGenome(size);
            network.reset(rnd);
            System.arraycopy(network.getLongTermMemory(), 0, genome.getData(), 0, size);
            defaultSpecies.add(genome);
        }

        // Set the genome factory to use the double array genome.
        result.setGenomeFactory(new DoubleArrayGenomeFactory(size));
View Full Code Here

        final RBFNetwork network = new RBFNetwork(codec.getInputCount(), codec.getRbfCount(), codec.getOutputCount());
        int size = network.getLongTermMemory().length;

        // Create a new population, use a single species.
        Population result = new BasicPopulation(POPULATION_SIZE, new DoubleArrayGenomeFactory(size));
        BasicSpecies defaultSpecies = new BasicSpecies();
        defaultSpecies.setPopulation(result);
        result.getSpecies().add(defaultSpecies);

        // Create a new population of random networks.
        for (int i = 0; i < POPULATION_SIZE; i++) {
            final DoubleArrayGenome genome = new DoubleArrayGenome(size);
            network.reset(rnd);
            System.arraycopy(network.getLongTermMemory(), 0, genome.getData(), 0, size);
            defaultSpecies.add(genome);
        }

        // Set the genome factory to use the double array genome.
        result.setGenomeFactory(new DoubleArrayGenomeFactory(size));
View Full Code Here

     * @return The new population.
     */
    private Population initPopulation(GenerateRandom rnd, EvaluateExpression eval) {
        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);

        return result;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public Species createSpecies() {
        final Species species = new BasicSpecies();
        species.setPopulation(this);
        getSpecies().add(species);
        return species;
    }
View Full Code Here

     * @return The population.
     */
    private Population initPopulation() {
        Population result = new BasicPopulation(PlantUniverse.POPULATION_SIZE, null);

        BasicSpecies defaultSpecies = new BasicSpecies();
        defaultSpecies.setPopulation(result);
        for (int i = 0; i < PlantUniverse.POPULATION_SIZE; i++) {
            final DoubleArrayGenome genome = randomGenome();
            defaultSpecies.add(genome);
        }
        result.setGenomeFactory(new DoubleArrayGenomeFactory(PlantUniverse.GENOME_SIZE));
        result.getSpecies().add(defaultSpecies);

        return result;
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.evolutionary.species.BasicSpecies

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.