Package ch.idsia.mario.simulation

Examples of ch.idsia.mario.simulation.BasicSimulator


    private void evaluateServerMode()
    {
        Server server = new Server(evaluationOptions.getServerAgentPort(), Environment.numberOfObservationElements, Environment.numberOfButtons);
        evaluationOptions.setAgent(new ServerAgent(server, evaluationOptions.isFastTCP()));

        Simulation simulator = new BasicSimulator(evaluationOptions.getSimulationOptionsCopy());
        while (server.isRunning())
        {
            String resetData = server.recvUnSafe();
            if (resetData.startsWith("ciao"))
            {
                System.out.println("Evaluator: ciao received from client; restarting server");
                server.restartServer();
                continue;
            }
            if (resetData.startsWith("reset"))
            {
                resetData = resetData.split("reset\\s*")[1];
                evaluationOptions.setUpOptions(resetData.split("[\\s]+"));
                //TODO: Fix this in more general way
                ((ServerAgent)evaluationOptions.getAgent()).setFastTCP(evaluationOptions.isFastTCP());
                init(evaluationOptions);
                // Simulate One Level
                EvaluationInfo evaluationInfo;

                long startTime = System.currentTimeMillis();
                String startMessage = "Evaluation started at " + GlobalOptions.getDateTime(null);
                LOGGER.println(startMessage, LOGGER.VERBOSE_MODE.ALL);

                simulator.setSimulationOptions(evaluationOptions);
                evaluationInfo = simulator.simulateOneLevel();

                evaluationInfo.levelType = evaluationOptions.getLevelType();
                evaluationInfo.levelDifficulty = evaluationOptions.getLevelDifficulty();
                evaluationInfo.levelRandSeed = evaluationOptions.getLevelRandSeed();
                evaluationSummary.add(evaluationInfo);
View Full Code Here


            this.evaluateServerMode();
            return null;
        }


        Simulation simulator = new BasicSimulator(evaluationOptions.getSimulationOptionsCopy());
        // Simulate One Level

        EvaluationInfo evaluationInfo;

        long startTime = System.currentTimeMillis();
        String startMessage = "Evaluation started at " + GlobalOptions.getDateTime(null);
        LOGGER.println(startMessage, LOGGER.VERBOSE_MODE.ALL);

        boolean continueCondition;
        int i = 0;
        do
        {
            LOGGER.println("Attempts left: " + (evaluationOptions.getMaxAttempts() - ++i ), LOGGER.VERBOSE_MODE.ALL);
            evaluationInfo = simulator.simulateOneLevel();
                                                       
            evaluationInfo.levelType = evaluationOptions.getLevelType();
            evaluationInfo.levelDifficulty = evaluationOptions.getLevelDifficulty();
            evaluationInfo.levelRandSeed = evaluationOptions.getLevelRandSeed();
            evaluationSummary.add(evaluationInfo);
View Full Code Here

TOP

Related Classes of ch.idsia.mario.simulation.BasicSimulator

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.