Skip to content

Replay Contest Submissions

John edited this page Sep 6, 2019 · 2 revisions

PC2v9 supports a feature to load and replay submissions. That is, once a contest has been concluded it is possible to "replay" the contest, by taking the collection of contest submissions and resubmitting them to an (empty) contest server.

Note: this feature is not complete; it is currently an ongoing development project. For this reason, the controls to invoke it (for example, the Replay tab mentioned below) are only accessible when either the PC2 Server or the PC2 Admin is started with the --debug option specified on the command line. Further, the Replay feature is currently only known to work on the Server (but not the Admin).

Overview

The replay operation takes as input a driver or action text file and the set of submission files (usually team run source files). Those files are created using the Extract Replay Runs report tool.

After the replay runs have been extracted into a file, the file must be loaded into the Server using the Replay tab's Load function. Once the replay runs have been loaded, the Replay tab controls can be used to start and control the playback.

Starting a Replay

  • Start a Server with the --debug option.
  • Create a contest (either use the -load option on the Server, or start an Admin and configure a complete contest).
  • Add runs to the contest (e.g. by logging in as a Team and submitting runs).
  • Run the Extract Replay Runs report to create a .txt file and team's source submission in sub-directories
    • Select the Reports tab on either the Server or the Admin.

    • Use the "Reports" dropdown to select Extract Replay Runs.

    • Click View Report to generate the Extract Replay Runs report.

    • Click Save and save a copy of the report in some location of your choosing.

    • Click Close to close the report generator.

    • Edit the saved .txt file and remove all lines up to the first line that looks like this:
      # ------------------------------------------------------------

    • Edit the saved .txt file: add profiles\ to start of mainfile path, thus s/mainfile=/mainfile=profiles/

  • On the Replay tab, use the Load button to load the .txt file. On success it will pop up a message "Loaded N events from " and add the N events into the grid.

Once the replay runs have been extracted and loaded, pressing the Replay Start button will start the replay. Various controls on the Replay pane can be used to control the replay (for example, replay event timings can be specified and replay event limits can be set).

Note that the Extract Replay Runs Report can also be created using the command line pc2report script.

Improvements Needed

  • Fix the Extract Replay Runs, output header info in comment
  • fix the Load, use a more robust way to find the mainfile
  • Fix the Playback GUI
    • ensure all controls work, esp the delay
    • add a playback speed field, contains the speed rate, default 1 (2 would be 2 times)
    • save all replay records and restore them on startup
    • implement Reset
    • more robust load, check that valid problems, teams, and languages are in driver file.
    • Provide control for playback using Admin
    • Fix Run One event feature
    • Add export
    • Really cool? Add export feature on Runs tab, let the user select the runs that te put into a driver file
  • Fix the Extract Replay Runs to work on the Admin

Sample Extract Replay Runs Report

Here is an example of the report .txt file (report.Extract_Replay_Runs.03.22.141.txt) with header lines removed

 # ------------------------------------------------------------
 # Extract Replay Runs
 # Created on Wed Mar 22 18:14:43 PDT 2017
 # Created by: Version 9.5build 20170309 (Thursday, March 9th 2017 16:15 UTC) Java ver 1.8.0_25 build 4114 Windows 7 6.1 (amd64) 
 
 action=RUN_SUBMIT| id=1| elapsed=22| language=Java| problem=Sumit| site=1| submitclient=team5| mainfile=profiles\P97c057df-fa99-45ac-aab6-ed6d02a4f901\reports\report.Extract_Replay_Runs.03.22.141.txt.files/site1run1/ISumit.java| 
 action=RUN_SUBMIT| id=2| elapsed=25| language=Java| problem=Sumit| site=1| submitclient=team5| mainfile=profiles\P97c057df-fa99-45ac-aab6-ed6d02a4f901\reports\report.Extract_Replay_Runs.03.22.141.txt.files/site1run2/ISumit.java| 
 action=RUN_SUBMIT| id=3| elapsed=34| language=Java| problem=Sumit| site=1| submitclient=team5| mainfile=profiles\P97c057df-fa99-45ac-aab6-ed6d02a4f901\reports\report.Extract_Replay_Runs.03.22.141.txt.files/site1run3/ISumit.java| 
 
 # All 0 runs extracted
 
 # EOF Extract Replay Runs
 # ------------------------------------------------------------
 
 # end 

PC2 Logo

Clone this wiki locally