Package eas.users.lukas.neuroCEGPM

Examples of eas.users.lukas.neuroCEGPM.RobNeural


        HashSet<RobNeural> visited = new HashSet<RobNeural>();
        LinkedList<RobNeural> tournament;
       
        while (visited.size() <= population.size() - tournamentSize) {
            tournament = new LinkedList<RobNeural>();
            RobNeural bestRob = null;
            double bestFit = Double.NEGATIVE_INFINITY;
           
            while (tournament.size() < tournamentSize) {
                RobNeural rob = population.get(rand.nextInt(population.size()));
               
                if (!visited.contains(rob)) {
                    tournament.add(rob);
                    visited.add(rob);
                   
                    if (rob.getFitness() > bestFit) {
                        bestFit = rob.getFitness();
                        bestRob = rob;
                    }
                }
            }
           
            LinkedList<Thread> threads = new LinkedList<Thread>();
            for (RobNeural rob : tournament) {
                LinkedList<BigDecimal> genomeTrans = null;
                if (bestRob.getGenomeTrans() != null) {
                    genomeTrans = new LinkedList<>(bestRob.getGenomeTrans());
                }
               
                threads.add(rob.setController(
                        new LinkedList<BigDecimal>(bestRob.getGenome()),
                        genomeTrans,
                        bestRob.getRand(),
                        true));
            }
           
            StaticMethods.joinThreads(threads);

            for (RobNeural rob : tournament) {
                rob.setFitness(bestRob.getFitness());
            }
        }
    }
View Full Code Here

TOP

Related Classes of eas.users.lukas.neuroCEGPM.RobNeural

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.