[Pogamut-list] Run bot automatically

DarthRoman pogamut-forum at artemis.ms.mff.cuni.cz
Wed Dec 10 11:53:03 CET 2008


Re: Run bot automatically

Author: DarthRoman

Hello to all of you!

Well, it's been a long time since the last time I wrote here, I've been very busy haha. I don't know very well how to explain all my doubts, but I'm gonna try.

First of all, I've been succeded executing GPBehaviours, but it only execute one experiment (Enemy vs. Bot0), after that it loads a new map, but connection is lost, so it can't continue.

Second, I've tried to execute TestJPPFExperimentExecutor but it's imposible, I obtained this message again and again (GridNode and GridDriver are working properly):

10-dic-2008 10:47:49 cz.cuni.pogamut.Parser.GameBotConnection connect
INFO: Connecting to GB: localhost/127.0.0.1:4996
UCCLOG ID0 No localization: Engine.Progress.RunningNet (in)
10-dic-2008 10:47:50 cz.cuni.pogamut.server.UCCWrapper$StreamSink handleInput
INFO: ID0 No localization: Engine.Progress.RunningNet (in)
10-dic-2008 10:47:50 cz.cuni.pogamut.Parser.GameBotConnection connect
GRAVE: Can't connect to GameBot (localhost/127.0.0.1:4996)
java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)

As I know, I think that it shuld try to connect to port 3000, not 4996, but that port changes in every execution, maybe is because of that that I can't execute it.

Third, I've tried to execute a LocalExperimentExecutor, thinking that it would be easier, but I always obtain the message that serverUri is null, and I don't know where to change it. In a previous post, you asked me for the code. It's this:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cuni.pogamut.experiments;

import cz.cuni.pogamut.server.UTServer;
import java.util.ArrayList;
import java.util.List;


/**
 * Test that executes N experiments on the Pogamut GRID.
 * @author Ik
 */
public class TestLocalExperimentExecutor {

    public static void main(String[] args) {
        // number of exeriments that will be send to the grid
        int N = 20;
        // list of experiments' descriptors
        List descriptors = new ArrayList();
        // populate the list in of descriptors by simple descriptor that executes
        // the Khepera X Hunter experiment
        for (int i = 0; i < N; i++) {
            descriptors.add(new ExperimentDescriptor() {

                public Experiment createExperiment(UTServer server) {
                    return new HunterXKheperaExperiment(this, server);
                }
                
            }); 
        }
        // create the JPPF experiment executor
        LocalExperimentExecutorImpl executor = new LocalExperimentExecutorImpl();
        // schedule the experiment for execution
        ExperimentHandle[] handles = executor.execute(descriptors);
        
        long startTime = System.currentTimeMillis();
        // wait until all experiments are finished
        ExperimentExecutor.waitForAll(handles);
        long timeElapsed = System.currentTimeMillis() - startTime;
        
        // sum of all execution times of experiments
        long totalTime = 0;
        // print the results
        for (ExperimentHandle handle : handles) {
            try{
                System.out.println(handle.getResult().toString());
                totalTime += handle.getResult().getSystemTimeLength();
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        
        System.out.println("TE: " + timeElapsed +  " TT: " + totalTime + " ratio: " + new Float(totalTime)/timeElapsed);
        // don't forget to always close the connection to the grid
        executor.close();
    }
}
 

I think it's very difficult to understand how to use PogamutGrid because there is no documentation to help us (there is a lot of think with TODO), and I think that it must be very easy to use it and configure it, but without documentation...

Anyways, I want to know if it would be very difficult to launch a UT server with the map and bots I choose, without using Pogamut Grid. That way, the only thing I would have to care about would be my genetic algorithm.

Thank you very very much.





More information about the Pogamut-list mailing list