Skip to main content

Week 5 Lab: Pricing the traffic

Preserve the clean-air clock, price a supplied rejoin packet once, and rank stop candidates by finishing position

22 March 2027

Two hours, worth 2%, completed and submitted inside the session. The codebase is standalone. It supplies Week 4’s correct candidate traces and totals; it does not import your earlier code.

What leaves the room is a position-aware evaluation of three supplied stop candidates. It retains the clean-air clock, adds one synthetic traffic charge, classifies each complete field and reports why the position-first call differs from Week 4’s minimum-time call.

Before the session

Install the supplied codebase and run its tests. Read the candidate, rejoin-ledger and field schemas, including every clock’s reference line and unit. Run the six-lap fixture and the full-race validator. The first may stop at an unimplemented packet detector; neither may fail while loading its inputs.

Hand-sort the six-lap fixture twice before you arrive: first by clean-air time, then by the supplied adjusted time. Bring both orders. The difference is the task, not a discrepancy to repair.

What is supplied

Every race value in these materials is fictional. The FIA regulation used in the class explains how a Race is classified; it does not supply this traffic equation or any of its values.

In the session

  1. Preserve both clocks (20 minutes). Load and validate the candidate, rejoin and field tables. Keep each candidate’s clean_air_finish unchanged and add a separate adjusted_finish. Reject mismatched units, a missing common reference line or a field row that does not complete 30 laps.
  2. Price the rejoin (35 minutes). At the common reference line, identify fixed cars that crossed before SlopU and remain within 1.000 s. Emit their names, packet size and traffic cost. An empty packet costs zero; otherwise apply 0.4 + 0.8 × packet_size seconds once to the candidate’s final total. Do not also slow its lap trace.
  3. Classify and compare (40 minutes). Sort each complete 30-lap field by adjusted finishing time and report SlopU’s position. Select the best finishing position, using adjusted time only to break a tie. Against Week 4’s pick, report clean-air time given up, adjusted-time change and places gained as three separate quantities.
  4. Validate and state the boundary (25 minutes). Match the six-lap fixture, unlock and match the full-race ground truth, then make a double-charge fixture fail. Finish with two sentences: why the answer changed, and why a fixed trace is not yet a responding rival.

The four time boxes total two hours.

What you hand over

A marker checks five things in the room:

Assignment 1’s contest criterion asks for a rival treated as responding rather than as a fixture. This lab establishes the position-aware comparison. Week 6 adds the response.

The spec

What you bring to the session. Written so a reader can tell whether it has been met without asking you.

Teaching team