Downloads

Executable JAR and source code for the visualizer. You compile the visualizer with Apache Ant.

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 methods initialize, asteroidAppearance and nextCommand, 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)

In order to run the tester / visualizer, 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 are optional):

 -exec,--e <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.
 -help,--h                     Print this message.
 -no_visualization,--n         Switches the visualization off, leaving
                               only text output.
 -pause,--p                    Starts visualizer in paused mode.
 -seed,--s <arg>               Sets the seed used for test case
                               generation. The default value is 1.
 -simulation_speed,--S <arg>   Sets number of events between visualized
                               frames. The default value is 1.

Visualizer works in two modes. In regular mode, every simulation_speed:th frame is visualized. In paused mode, every event is visualized, but the simulation will only proceed one event each time a key (except space and 'q') is pressed. The space key can be used to switch between regular and paused mode. The default starting mode is regular. You can use -pause parameter to start in paused mode. You can press 'q' to quit the simulation. You can press '+' or '-' to change the simulation speed in regular mode.

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.