Downloads


In order to use the offline tester / visualizer tool for testing your solution locally, you'll have to modify your solution by adding the main method that interacts with the tester / visualizer via reading data from standard input and writing data to standard output. As long as you do not change the implementation of your methods, this doesn't affect the way your solution works when being submitted to our server.

To simulate a single test case, your program should implement the following protocol (each integer is to be read from / printed in a separate line):

In other words, you should implement the following pseudocode in the main method of your solution:

    
N = parseInt(readLine())
for (i=0; i < N; j++)
    plyData[i] = readLine()
ret = trainingModel(plyData)
printLine(ret)
flush(stdout)
if (ret==1) goto StartTesting
      
NumPairs = parseInt(readLine())
for (f = 0; f < NumPairs; f++)
{
    for (j=0; j < 1600*1200; j++)
        leftImage[j] = parseInt(readLine())
    for (j=0; j < 1600*1200; j++)
        rightImage[j] = parseInt(readLine())
    G = parseInt(readLine())
    for (j=0; j < G; j++)
        groundTruth[j] = parseDouble(readLine())
    ret = trainingPair(leftImage, rightImage, groundTruth)
    printLine(ret)
    flush(stdout)
    if (ret==1) goto break
}
StartTesting:
doneTraining()
NumPairs = parseInt(readLine())
for (f = 0; f < NumPairs; f++)
{
    for (j=0; j < 1600*1200; j++)
        leftImage[j] = parseInt(readLine())
    for (j=0; j < 1600*1200; j++)
        rightImage[j] = parseInt(readLine())
    ret[] = testingPair(leftImage, rightImage)
    for (j=0; j < 7; j++)
        printLine(ret[j])
    flush(stdout)
}

In order to run the tester / visualizer, you should use the following command:

java -jar tester.jar -exec "<command>" -train example_data/training.csv -test example_data/testing.csv -folder example_data/

<command> is the command you would use to execute your solution. If your compiled solution is an executable file, the command will just be the full path to it, for example, "C:\TopCoder\solution.exe" or "~/topcoder/solution". In case your compiled solution is to be run with the help of an interpreter, for example, if you program in Java, the command will be something like "java -cp C:\TopCoder Solution".

The *.ply files should be in the same folder as the tester.jar file.

Additionally you can use the following parameters:

You can print any debug information of your solution to the standard error stream and it will be forwarded to the standard output of the tester.

For more information on using visualizers, please check the following recipe draft from TopCoder Cookbook. Note that this is not a troubleshooting thread, please use the match forum for questions instead.