Project 2: Cellphone Dodgem

People often walk around while engaged with their cellphones, not looking around for obstacles or other people. I've personally witnessed a cellphone user obliviously walking straight into a signpost. Nevertheless, in these days of multitasking, users perceive a high value to remaining engaged on their phones even at the expense of impaired navigation.

In this project, we're going to simulate a large flea market with stalls in random locations within a field of size 100m by 100m. Players (coded by you) are tasked with moving from stall to stall in order to purchase certain items. The set of stalls you need to visit is given to you in advance, along with their coordinates, and you can visit them in any order.

While walking from stall to stall, your player will mostly have their eyes on their cellphone, meaning that they do not observe anything in their vicinity. Players can move at 1m/s in any direction even while looking at their phones. However, if a player encounters an obstacle or another player within 0.5m, they stop abruptly. When a player stops in this way, the cellphone is knocked out of the player's hand and cellphone use is interrupted. It takes the player 10 seconds to recover the cellphone and become ready to move again.

Players can also look up while walking. Looking up interrupts the cellphone interaction, but provides information about the local environment. Looking up for one second gives information about the positions of all obstacles/players within 10m. Looking up for two or more seconds will enable you to track the movement of other players around you. If you don't explicitly look up on a turn, the simulator will assume you're going back to your phone. You can look up on several turns in succession if you wish. You achieve satisfaction from continuous interactions with your phone, equal to $S \log_2 S$ points where S is the number of seconds in an interaction. So one long interaction is rewarded more highly than two short interactions with the same total length.

A stall is a 2m by 2m square whose sides are aligned with the field boundaries. When you reach within 1m of a stall's edge, you can obtain the item you were looking for (you need to look up to execute the transaction). There are many players playing in the flea market in parallel. Each player will need to get the same number of items from the same locations, selected at random by the simulator. All players start in randomized locations on the perimeter of the field. The game ends for a player when time expires. Note that players are still active after they purchase their last item, and can continue to accumulate cellphone satisfaction. The simulator knows the distance between stalls on the target path, and can estimate the time T it would take to complete the circuit by walking in a straight line uninterrupted on a short path (e.g., using a Traveling Salesman approximation algorithm). The simulator will place a threshold of $T\theta$ on the simulation time, where $\theta \geq 1$ is a stringency parameter. Small values of $\theta$ don't give much leeway for delays or inefficient paths. Larger values lead to a more relaxed outing. Your players will know the $T\theta$ threshold at the start of the simulation. When the simulation ends, players will be ranked according to the following metric in lexicographically decreasing order: (I,C) where I is the number of items obtained, and C is the total accumulated cellphone satisfaction.

Ken Ross 2023-10-17