Package ch.idsia.ai.agents

Examples of ch.idsia.ai.agents.Agent


    public double evaluateLargeSRN (double[][] inputs, double[][] recurrent, double[][] output, int level, int seed) {
        // System.out.println(inputs.length+" "+inputs[0].length);
        // System.out.println(recurrent.length+" "+recurrent[0].length);
        // System.out.println(output.length+" "+output[0].length);
        SRN srn = new SRN (inputs, recurrent, output, recurrent.length, output[0].length);
        Agent agent = new LargeSRNAgent(srn);
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        final int startingSeed = 0;
        options.setLevelRandSeed(seed);
        options.setMaxAttempts(1);
        options.setVisualization(false);
        options.setMaxFPS(true);
        options.setLevelDifficulty(level);
        options.setPauseWorld(false);
        agent.reset();
        options.setAgent(agent);
        Evaluator evaluator = new Evaluator (options);
        EvaluationInfo result = evaluator.evaluate().get(0);
       // System.out.print(".");
        double score = result.computeDistancePassed();
View Full Code Here


    public void evaluateLargeSRN (double[][] inputs, double[][] recurrent, double[][] output, int level) {
        // 98 * 6
        // 6*6
        // 6*6
        SRN srn = new SRN (inputs, recurrent, output, recurrent.length, output[0].length);
        Agent agent = new LargeSRNAgent(srn);
        Stats.doStats(agent, 0);
    }
View Full Code Here

public class StochasticityTest {

    final static int repetitions = 10;

    public static void main(String[] args) {
        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);
View Full Code Here

    public double evaluateLargeSRN (double[][] inputs, double[][] recurrent, double[][] output, int level,int seed) {
        // System.out.println(inputs.length+" "+inputs[0].length);
        // System.out.println(recurrent.length+" "+recurrent[0].length);
        // System.out.println(output.length+" "+output[0].length);
        SRN srn = new SRN (inputs, recurrent, output, recurrent.length, output[0].length);
        Agent agent = new LargeSRNAgent(srn);
        EvaluationOptions options = new CmdLineOptions(new String[0]);
        options.setLevelRandSeed(seed);
        options.setMaxAttempts(1);
        options.setVisualization(true);
        options.setMaxFPS(false);
        options.setLevelDifficulty(level);
        options.setPauseWorld(false);
        agent.reset();
        options.setAgent(agent);
        Evaluator evaluator = new Evaluator (options);
        EvaluationInfo result = evaluator.evaluate().get(0);
       // System.out.print(".");
        double score = result.computeDistancePassed();
View Full Code Here

    final static int numberOfTrials = 50;

    public static void main(String[] args) {

        Agent controller = RegisterableAgent.load ("com.reddit.programming.mario.BestFirstAgent");
        final int startingSeed = Integer.parseInt ("0");
        doStats (new TimingAgent(controller), startingSeed);
        //System.exit(0);
    }
View Full Code Here

      length = Integer.parseInt(args[3]);
    }

    GlobalOptions.drawText = false;
    while (true) {
      Agent controller = new BestFirstAgent(); // This line uses the agent you imported above.
      if (args.length > 0) {
        controller = RegisterableAgent.load (args[0]);
        RegisterableAgent.registerAgent (controller);
      }
      GlobalOptions.setSeed(seed);
      GlobalOptions.setDifficulty(difficulty);
     
     
      GlobalOptions.currentController = controller.getName();
      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);
View Full Code Here

                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");
View Full Code Here

public class CompetitionScore {

    final static int numberOfTrials = 10;

    public static void main(String[] args) {
        Agent controller = RegisterableAgent.load ("com.reddit.programming.mario.BestFirstAgent");
        final int startingSeed = Integer.parseInt ("0");
        score (controller, startingSeed);
        System.exit (0);
    }
View Full Code Here

    }

    private EvaluationOptions prepareEvaluatorOptions()
    {
        EvaluationOptions evaluationOptions = cmdLineOptions;
        Agent agent = RegisterableAgent.getAgentByName(ChoiceAgent.getSelectedItem());
        evaluationOptions.setAgent(agent);
        int type = ChoiceLevelType.getSelectedIndex();
        if (type == 4)
            type = (new Random()).nextInt(4);
        evaluationOptions.setLevelType(type);
View Full Code Here

        this.setSimulationOptions(simulationOptions);
    }

    private MarioComponent prepareMarioComponent()
    {
        Agent agent = simulationOptions.getAgent();
        agent.reset();
        marioComponent.setAgent(agent);
        return marioComponent;
    }
View Full Code Here

TOP

Related Classes of ch.idsia.ai.agents.Agent

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.