Package ch.idsia.tools

Examples of ch.idsia.tools.EvaluationOptions


    }

    public static void score (Agent agent, int startingSeed) {
        TimingAgent controller = new TimingAgent (agent);
        RegisterableAgent.registerAgent (controller);
        EvaluationOptions options = new CmdLineOptions(new String[0]);

        options.setMaxAttempts(1);
        options.setVisualization(false);
        options.setMaxFPS(true);
        System.out.println("Scoring controller " + controller + " with starting seed " + startingSeed);

        double competitionScore = 0;

        competitionScore += testConfig (controller, options, startingSeed, 0, false);
View Full Code Here


    final static int generations = 100;
    final static int populationSize = 100;

    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);
        options.setMaxFPS(true);
            options.setVisualization(false);
            //Task task = new ProgressTask(options);
            MultiSeedProgressTask task = new MultiSeedProgressTask(options);
            task.setNumberOfSeeds(3);
            task.setStartingSeed(0);
            ES es = new ES (task, initial, populationSize);
            System.out.println("Evolving " + initial + " with task " + task);
            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);
                options.setVisualization(gen % 5 == 0 || bestResult > 4000);
                options.setMaxFPS(true);
                Agent a = (Agent) es.getBests()[0];
                a.setName(((Agent)initial).getName() + gen);
                RegisterableAgent.registerAgent(a);
                double result = task.evaluate(a)[0];
                options.setVisualization(false);
                options.setMaxFPS(true);
                Easy.save (es.getBests()[0], "evolved.xml");
                if (result > 4000) {
                    break; //finished
                }
            }
View Full Code Here

      RegisterableAgent.registerAgent (controller);
    }

    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

public class MainRun
{
    public static void main(String[] args) {
        CmdLineOptions cmdLineOptions = new CmdLineOptions(args);
        EvaluationOptions evaluationOptions = cmdLineOptions;  // if none options mentioned, all defalults are used.
        createNativeAgents(cmdLineOptions);
        Evaluator evaluator = new Evaluator(evaluationOptions);
        List<EvaluationInfo> evaluationSummary = evaluator.evaluate();
//        LOGGER.save("log.txt");
View Full Code Here

    final static int generations = 100;
    final static int populationSize = 100;


    public static void main(String[] args) {
        EvaluationOptions options = new CmdLineOptions(args);
        options.setMaxAttempts(1);
        options.setPauseWorld(true);
        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);
            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)
                    break; // Go to next difficulty.
            }
        }
View Full Code Here

TOP

Related Classes of ch.idsia.tools.EvaluationOptions

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.