Robot vacuum simulation

Motivation

Robot vacuums can apply different strategies while cleaning the floor. I wanted to compare two strategies adopted by a robot vacuum to find out which one is optimal in terms of time.

Implementation

Two strategies were simulated for this study. The first strategy involves a robot vacuum cleaning the floor tiles in the direction it is facing until it encounters a boundary—let’s refer to this as the standard strategy. The second strategy involves the robot choosing a random direction whenever it needs to clean a new tile—let’s call this the random walk strategy.

Standard strategy

The following demonstrates multiple runs of this strategy employed by a robot vacuum. A cleanliness threshold of 40% is selected as the cutoff point for the room.

Random walk strategy

On the contrary, a random walk strategy is illustrated below for multiple iterations. Once again, a cleanliness ratio of 40% is chosen as the cutoff point.

Final results

Multiple robot vacuums

Now, I want to compare the time it takes to clean 80% of the room using an increasing number of robots, ranging from 1 to 10. As shown below, a robot vacuum employing the standard strategy takes less time than the one using the random walk strategy, particularly when the number of robot vacuums is low.

Aspect ratio’s impact on cleaning time

How would different heights and widths of the room impact the cleaning time for the different strategies? The following provides the answer to this question.

Once again, it is evident that a robot vacuum utilizing the standard strategy outperforms the other strategy, particularly when the aspect ratio is high. The sizes of the rooms are as follows.

Width Height Aspect ratio
10 30 \frac{1}{3}
20 15 \frac{4}{3}
25 12 \frac{25}{12}
50 6 \frac{25}{3}