Downloads

Executable JAR and source code for the local tester.


In order to use the offline tester 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 methods SetEconomyParameters and ConsumptionDecisionRule, this doesn't affect the way your solution works when being submitted to our server.

You interact with the visualizer in the following way: (standard in/out)

This is equivalent to the following pseudocode:

   X = parseInteger(readLine())
   loop X times:
      beta = parseDouble(readLine())
      eta = parseDouble(readLine())
      alpha = parseDouble(readLine())
      delta = parseDouble(readLine())
      rho = parseDouble(readLine())
      sigma = parseDouble(readLine())
      N = parseInteger(readLine())
      T = parseInteger(readLine())
      
      SetEconomyParameters(beta, eta, alpha, delta, rho, sigma, N, T)
      
      loop T times:
         loop N times (index i):
            Kt[i] = parseDouble(readLine())
         loop N times (index i):
            Zt[i] = parseDouble(readLine())
         
         Ct = ConsumptionDecisionRule(Kt, Zt)
         
         loop N times (index i):
            printLine(Ct[i])

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

java -jar AsteroidTrackerVisualizer.jar -exec "<command>"

<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".

Additionally you can use the following parameters (all but -exec are optional):

 -exec <arg>                   Sets 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.
							   
 -test <arg>                   Sets the file containing the test cases 
                               used in this test. The default test case file
                               is "example_economies.csv".

 -silent                       Suppresses debug output.

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.