Skip to main content

Section 8.4 ActiveCode Challenge: Simulating a Multi-Robot Auction System

In this hands-on exercise, you will complete a pure Python simulation of a market-based auction system for a 2-robot fleet.
Because Runestone environments do not support external network or graphics libraries, you will use pure Python lists, dictionaries, and math functions to calculate travel distances, evaluate bids, and assign tasks.

Subsection 8.4.1 Section 8.4 Interactive Exercises

Subsubsection 8.4.1.1 Exercise 8.4.1: Multi-Robot Auction Simulator

Complete the task assignment auction loop below.
Task:
  1. Complete the calculate_bid function to compute the Euclidean distance between a robot’s current position and a task position:
    \(\text{Distance} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\)
  2. Iterate through the task list, determine which available robot has the lowest cost bid for each task, and assign ownership accordingly!

Reading Questions 8.4.2 Reading Questions

Check your understanding

1. Exercise 8.4.2: Misclassified Cargo Conceptual Check.

A cargo-sorting robot’s vision system reports low classification confidence for an object sitting between two bins. The routing logic must decide what to do before the arm commits to a pickup.
What is the best design choice for the robot’s routing logic in this situation?
  • Pick the bin with the higher of the two possible scores, no matter how small the margin.
  • Committing to whichever score is higher, even by a negligible margin, ignores the fact that the classifier itself reported low confidence in either answer.
  • Route the item to a holding zone or request another sensor reading before committing.
  • Correct. Committing to a low-confidence classification risks an incorrect placement that is costly to reverse, so the safer design treats low confidence as its own case rather than forcing a guess between the two closest categories.
  • Skip the item entirely and never attempt to sort it.
  • Permanently abandoning the item discards a task that could still be completed correctly with a second reading or a brief hold, so this throws away recoverable work.
  • Always default to the near-side bin regardless of classification.
  • Ignoring the classifier output entirely and routing by convenience defeats the purpose of the vision system and will misplace cargo whenever the near-side bin is wrong.
You have attempted of activities on this page.