Contest Clock - pc2ccs/pc2v9 GitHub Wiki

Overview

PC² manages contest time by maintaining a notion called the contest clock. The contest clock is disassociated from real time; rather, it keeps track of how much "contest time" has elapsed relative to the configured "contest length".

Initially, the contest clock is stopped (that is, configuring a new contest initializes the contest clock to the "stopped" state). No time elapses on the contest clock when it is stopped, regardless of how much real time passes. Shutting down a contest (meaning, shutting down the PC² server) while the contest clock is stopped and then restarting the server at a later time (even days or months later) causes no time to elapse on the contest clock.

The contest is considered to be "not running" when the contest clock is stopped, and certain actions (such as a Team sending a Submission to the judges) are blocked when the contest is not running. A contest (meaning, the contest clock) can be started in one of two ways: manually or automatically (see below).

When the contest clock is started it takes on the value of the amount of time remaining in the contest. The first time the contest clock is started, this value will be the configured contest length; thereafter -- for example if the contest clock is subsequently stopped and then restarted -- the value taken on by the clock when it is restarted will be the amount of time remaining in the contest, which is to say the difference between the originally-specified contest length and the amount of time which elapsed while the clock was previously running.

At all times when the contest is running, the contest clock continually "counts down" from its current value toward zero. (What happens when it reaches zero depends on the value of the Stop contest automatically checkbox on the Administrator client; see the PC² Contest Administrator's Guide for details).

The current value of the contest clock is used to "timestamp" submissions. Contest clock timestamps in submissions are always in whole minutes and are used as the "submission time" value which is used in scoring calculations (for example in the Scoreboard Client). (The system also maintains an internal timestamp at the millisecond precision level, but scoreboard calculations follow the ICPC standard scoring scheme of minute-resolution.)

In a Multi-Site contest each site has its own contest clock; the clocks at different sites can be started/stopped/restarted independently and PC² will use submission timestamps based on the clock values at each site to compute overall scoring results.

Manual Clock Control

Configuring the contest clock is done via the Configure Contest > Times tab on the Administrator Client. Selecting a site row in the Times table and pressing the Edit button will display the following Edit Contest Time dialog:

/images/EditTimeScreen.png

Entering the desired values for Contest Length, Current Elapsed Time, and Current Remaining Time and then clicking Update will set the contest clock to the specified values (but will not start it). Note: the Update button will not work if the time values are not consistent; for example, it must be the case that the sum of Elapsed Time and Remaining Time equals Contest Length.

Note that the above dialog also contains a Stop contest automatically checkbox; checking this will cause the contest to stop when the contest clock counts down to zero (leaving it unchecked allows the contest to continue running, meaning that teams can continue to send in submissions).

Once the contest clock values are set, pressing the "Start" button on Configure Contest > Times screen starts the contest by starting the contest clock running (counting down). The contest clock can be manually stopped by pressing the "Stop" button on the same screen. The Start ALL and Stop ALL buttons on that same screen can be used to simultaneously control the clocks at all sites in a Multi-Site contest contest.

A typical use of manual contest clock start/stop is when it is desired to insert a "break" into the contest -- for example, a lunch or snack break during which time the contest is considered "suspended". No time elapses on the contest clock during the time the contest is stopped; when teams return from the break and the contest clock is started again the contest clock has exactly the same "remaining contest time" as it had at the moment it was stopped, regardless of how much real time elapsed in the mean time.

Automated Clock Control

Setting up Automated Start

A PC² contest can be configured to “automatically start” when a specified date/time has arrived. This is done by pressing the Edit Start Schedule button on the Administrator's Configure Contest > Times tab. This displays the following dialog:

/images/ScheduledStartTimeScreen.png

The widgets in this dialog can be used to remove any previously-set "scheduled start time" (in which case the contest will not start automatically), or to configure the contest to start any time from "now" forward. Clicking Update will then configure the contest to start at the specified time.

Automated Starting via Web Interface

  • TBD

See Also:

Contest Clock Control Implementation Details