I don't think it does. That is, the quasicode algorithm looks something like this:
def fulfill_order(order):
range = 3 * miles
surge = 1
workers = workers_in_range(order.location, range)
while len(workers) == 0:
range *= 2
workers = workers_in_range(order.location, range)
surge += 1
if surge > 2:
initiate_surge_pricing(order.location, surge)
lowest_cost = min(w.cost for w in workers)
workers = random.shuffle([w for w in workers if w.cost == lowest_cost])
for w in workers:
if worker.propose_order(order):
return order.assign_worker(worker)
# if we're still here no worker has accepted the proposal
order.raise_bonus()
return defer_retry_order(order)
This does not read as incompetent pseudocode, to me! But it has the crucial problem.
Just to be clear about how the algorithm is lying, once you are near bonus and thus you're not in that lowest_cost bracket, you need an actual prediction of a place where demand is going to outstrip supply. The incentive system is reactive to actual demand and thus hopelessly noisy as a lagging prediction of demand, and it is being broadcast to try to manipulate driver behavior which means it also secretly forecasts a supply spike. So if we take it as 50% that the surge in demand is real and 50% that the added supply doesn't cover the added demand, then your actual number of surges you have to chase across the city is a geometric random variable with p=25%, and geometric random variables have the frustrating property of being memoryless like a good casino is: if you're exhausted after you've failed to make it after chasing 4 surges across the city, the expected number of surges you have to chase to get your bonus is, well, 4 more. And if you're at your wits' end after those 4 more, the expectation is, well, 4 more.
Just to be clear about how the algorithm is lying, once you are near bonus and thus you're not in that lowest_cost bracket, you need an actual prediction of a place where demand is going to outstrip supply. The incentive system is reactive to actual demand and thus hopelessly noisy as a lagging prediction of demand, and it is being broadcast to try to manipulate driver behavior which means it also secretly forecasts a supply spike. So if we take it as 50% that the surge in demand is real and 50% that the added supply doesn't cover the added demand, then your actual number of surges you have to chase across the city is a geometric random variable with p=25%, and geometric random variables have the frustrating property of being memoryless like a good casino is: if you're exhausted after you've failed to make it after chasing 4 surges across the city, the expected number of surges you have to chase to get your bonus is, well, 4 more. And if you're at your wits' end after those 4 more, the expectation is, well, 4 more.