Package ch.idsia.ai.tasks

Examples of ch.idsia.ai.tasks.MultiDifficultyProgressTask


        options.setPauseWorld(false);
        Evolvable initial = new SmallMLPAgent();
        RegisterableAgent.registerAgent ((Agent) initial);
        options.setMaxFPS(true);
        options.setVisualization(false);
        MultiDifficultyProgressTask task = new MultiDifficultyProgressTask(options);

        ES es = new ES (task, initial, populationSize);
        System.out.println("Evolving " + initial + " with task " + task);
        final String fileName = "evolved" + (int) (Math.random () * Integer.MAX_VALUE) + ".xml";
        for (int gen = 0; gen < generations; gen++) {
            task.setStartingSeed((int) (Math.random () * Integer.MAX_VALUE));
            es.nextGeneration();
            double bestResult = es.getBestFitnesses()[0];
            System.out.println("Generation " + gen + " best " + bestResult);
            Evolvable bestEvolvable = es.getBests()[0];
            double[] fitnesses = task.evaluate((Agent) bestEvolvable);
            System.out.printf("%.4f  %.4f  %.4f  %.4f  %.4f\n",
                    fitnesses[0], fitnesses[1], fitnesses[2], fitnesses[3], fitnesses[4]);
            Easy.save (es.getBests()[0], fileName);
        }
        Stats.main(new String[]{fileName, "0"});
View Full Code Here

TOP

Related Classes of ch.idsia.ai.tasks.MultiDifficultyProgressTask

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.