Package ch.idsia.ai

Examples of ch.idsia.ai.Evolvable


    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setMaxAttempts(1);
        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);
        }
View Full Code Here


    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setMaxAttempts(1);
        options.setPauseWorld(false);
        Evolvable initial = new SimpleMLPAgent();
        RegisterableAgent.registerAgent ((Agent) initial);
        options.setMaxFPS(true);
        options.setLevelDifficulty(0);
        options.setVisualization(false);
        ProgressTask task = new ProgressTask(options);
View Full Code Here


    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setMaxAttempts(1);
        Evolvable initial = new LargeSRNAgent();
        if (args.length > 0) {
            initial = (Evolvable) RegisterableAgent.load (args[0]);
        }
        RegisterableAgent.registerAgent ((Agent) initial);
        options.setMaxFPS(true);
View Full Code Here

    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setMaxAttempts(1);
        options.setPauseWorld(true);
        Evolvable initial = new SimpleMLPAgent();
        if (args.length > 0) {
            initial = (Evolvable) RegisterableAgent.load (args[0]);           
        }
        RegisterableAgent.registerAgent ((Agent) initial);
        for (int difficulty = 0; difficulty < 11; difficulty++)
View Full Code Here

    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setMaxAttempts(1);
        options.setPauseWorld(true);
        Evolvable initial = new LargeMLPAgent();
        if (args.length > 0) {
            initial = (Evolvable) RegisterableAgent.load (args[0]);
            //RegisterableAgent.registerAgent ((Agent) initial);
        }
        RegisterableAgent.registerAgent ((Agent) initial);
View Full Code Here

    private void swap(int i, int j) {
        double cache = fitness[i];
        fitness[i] = fitness[j];
        fitness[j] = cache;
        Evolvable gcache = population[i];
        population[i] = population[j];
        population[j] = gcache;
    }
View Full Code Here

        List<Agent> bestAgents = new ArrayList<Agent>();
        DecimalFormat df = new DecimalFormat("0000");
        for (int difficulty = 0; difficulty < 11; difficulty++)
        {
            System.out.println("New Evolve phase with difficulty = " + difficulty + " started.");
            Evolvable initial = new SimpleMLPAgent();

            options.setLevelDifficulty(difficulty);
            options.setAgent((Agent)initial);

            options.setMaxFPS(true);
View Full Code Here

TOP

Related Classes of ch.idsia.ai.Evolvable

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.