Downloads

Source
Jar

Usage

A simple tool is provided for offline testing. To use it, you need to write a program that reads from standard in and writes to standard out. It should first read the parameters to init, which will all be on one line, in the order p_mut, p_change, p_ret, separated by spaces. Each zebra will then by specified by three lines. The first line will correspond to the int[] bases. It will start with the number of integers, N, and then be followed by N integers. The next line will contain the 10 elements of chromosomes. Finally, the third line will contain the other parameters, in the order age, gender, index. After receiving all the input, you should write your relatedness String[], one element per line. By sure that you flush your buffers after outputting. Your code might end up looking something like this:

    p_mut = nextDouble()
    p_change = nextDouble()
    p_ret = nextDouble()
    for(i = 0; i < 100; i++){
        len = nextInt()
        for(j = 0; j < len; j++)
            base[i][j] = nextInt()
        for(j = 0; j < 10; j++)
            chromosomes[i][j] = nextInt()
        age[i] = nextInt()
        gender[i] = nextChar()
        index[i] = nextChar()
    }
    ...
    for(i = 0; i < 100; i++){
        println(ret[i])
    }
    flush(stdout)
To use the tool, simply run:
java -Xmx512M -jar Zebras.jar -seed S "Your command"
Where seed is the test case seed, and "Your command" is the executable command to run. Additionally, you may specify the probabilities by doing -p_mut, -p_change and/or -p_ret. Your command must always be the last argument though.

Any debugging output that you write to standard error will be sent to the terminal. Be careful not to write debugging output to standard out, as it will be incorrect interpreted.