Package ch.idsia.ai.tasks

Examples of ch.idsia.ai.tasks.Task


        Agent controller = RegisterableAgent.load (args[0]);
        RegisterableAgent.registerAgent (controller);
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setAgent(controller);
        options.setPauseWorld (false);
        Task task = new ProgressTask(options);
        options.setMaxFPS(true);
        options.setVisualization(false);     
        options.setMaxAttempts(1);
        options.setMatlabFileName("");
        task.setOptions(options);
        for (int i = 0; i < repetitions; i++) {
            System.out.println ("Score: " + task.evaluate (controller)[0]);
        }
    }
View Full Code Here


      GlobalOptions.writeFrames = false; //set to true to write frames to disk
      GlobalOptions.TimerOn = false;
      GlobalOptions.dontResetWindowPosition = true;
      EvaluationOptions options = new CmdLineOptions(new String[0]);
      options.setAgent(controller);
      Task task = new ProgressTask(options);
      options.setMaxFPS(false);
      options.setVisualization(true);
      options.setMaxAttempts(1);
      options.setMatlabFileName("");
      options.setLevelLength(length);
      options.setLevelRandSeed(seed);
      options.setLevelDifficulty(difficulty);
      options.setTimeLimit(0);
     
      task.setOptions(options);

      System.out.println("Score: " + ArrayUtils.toString(task.evaluate(controller)));
      System.out.println("Seed: " + options.getLevelRandSeed());
      System.out.println("Difficulty: " + options.getLevelDifficulty());
      seed++;
    }
  }
View Full Code Here

            controller = RegisterableAgent.load (args[0]);
            RegisterableAgent.registerAgent (controller);
        }*/
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        //options.setAgent(controller);
        Task task = new ProgressTask(options);
        options.setMaxFPS(false);
        options.setVisualization(false);
        options.setMaxAttempts(1);
        options.setMatlabFileName("");
        options.setLevelRandSeed(seed);
        options.setLevelDifficulty(10);
        GlobalOptions.FPS = GlobalOptions.InfiniteFPS;
        task.setOptions(options);
       
        GA vivarium = new GA(task, new GeneticAgent(), 60);
       
        for (int i = 0; i < 30; i++)
        {
          System.out.println("Best of Gen " + i + ": " + vivarium.getBestFitnesses()[0]);
          vivarium.nextGeneration();
          System.out.flush();
        }

        System.out.println("Score: " + ArrayUtils.toString(task.evaluate(controller)));
        System.out.println("Seed: " + options.getLevelRandSeed());
        System.out.println("Difficulty: " + options.getLevelDifficulty());
        System.out.println("Best Genome: " + vivarium.getBests()[0]);
    }
View Full Code Here

    GlobalOptions.currentController = controller.getName();
    GlobalOptions.writeFrames = false; //set to true to write frames to disk
    EvaluationOptions options = new CmdLineOptions(new String[0]);
    options.setAgent(controller);
    Task task = new ProgressTask(options);
    options.setMaxFPS(false);
    options.setVisualization(true);
    options.setMaxAttempts(1);
    options.setMatlabFileName("");
    options.setLevelLength(length);
    options.setLevelRandSeed(seed);
    options.setLevelDifficulty(difficulty);
    task.setOptions(options);

    System.out.println("Score: " + ArrayUtils.toString(task.evaluate(controller)));
    System.out.println("Seed: " + options.getLevelRandSeed());
    System.out.println("Difficulty: " + options.getLevelDifficulty());
  }
View Full Code Here

            options.setAgent((Agent)initial);

            options.setMaxFPS(true);
            options.setVisualization(false);

            Task task = new ProgressTask(options);
            ES es = new ES (task, initial, populationSize);

            for (int gen = 0; gen < generations; gen++) {
                es.nextGeneration();
                double bestResult = es.getBestFitnesses()[0];
//                LOGGER.println("Generation " + gen + " best " + bestResult, LOGGER.VERBOSE_MODE.INFO);
                System.out.println("Generation " + gen + " best " + bestResult);
                options.setVisualization(gen % 5 == 0 || bestResult > 4000);
                options.setMaxFPS(true);
                Agent a = (Agent) es.getBests()[0];
                a.setName(((Agent)initial).getName() + df.format(gen));
                RegisterableAgent.registerAgent(a);
                bestAgents.add(a);
                double result = task.evaluate(a)[0];
//                LOGGER.println("trying: " + result, LOGGER.VERBOSE_MODE.INFO);
                options.setVisualization(false);
                options.setMaxFPS(true);
                Easy.save (es.getBests()[0], "evolved.xml");
                if (result > 4000)
View Full Code Here

TOP

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

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.