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#
- Preserve both clocks (20 minutes). Load and validate the candidate,
rejoin and field tables. Keep each candidate’s
clean_air_finishunchanged and add a separateadjusted_finish. Reject mismatched units, a missing common reference line or a field row that does not complete 30 laps. - 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 apply0.4 + 0.8 × packet_sizeseconds once to the candidate’s final total. Do not also slow its lap trace. - 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.
- 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:
- packet membership and exactly one traffic charge for each candidate;
- both six-lap sorted fields and their change of winner;
- all three 30-lap classifications and the selected position-optimal stop;
- the clean-air cost, adjusted-time gain and place gain reported separately, matching the unlocked ground truth;
- the rejected double-charge fixture and the two-sentence boundary.
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.
- the supplied codebase installs and its own test suite passes on your machine
- the candidate, rejoin-ledger and field schemas have been read, including every unit
- the six-lap fixture has been hand-sorted by clean-air time and by supplied adjusted time
- the full-race validator reaches the unimplemented packet detector without an earlier failure
Teaching team
- Naila Sorge — Tutor, leading this week
- Tobias Wren — Tutor
- Kwame Ferriter — Tutor