Cubicle Selection Algorithm
It's the unspoken law. The law of the workplace bathroom.
Which cubicle do you select, and why? It's long been a theory
of mine that there is an unspoken, shared understanding of which
cubicle is the least socially awkward one to choose when walking
into an already occupied bathroom. The general rules are:
-
You should always leave one empty stall between yourself and an
adjacent user of the facilities.
-
If you cannot select a cubicle that leaves an empty stall to
both sides, you should pick one at either end.
-
If you walk in directly behind someone, you should pick a cubicle
that is furthest from the stall that person chooses.
-
If there are an odd number of stalls, you should pick one that is
at either end, or a multiple of two stalls from the end so that there
is a maximum likelihood of others picking a stall that satisfies the
above rules.
-
If there is an even number of stalls, and a number of others are
occupied that do not leave even spacing between them, you should
choose a stall that maximises the global 'goodness' - if one person
has picked alignment with the left end of the stalls, and two
people are aligned with the right end, you should measure spacing
from the right end.
-
If all stalls are occupied, you should choose a stall furthest from
the door or sinks.
Implementation
Loading...
Red squares are 'occupied' cubicles, the green square is the suggested
cubicle, and yellow represents the location of the external door.
Click on the door to toggle the position from left to right, and click
on a cubicle to toggle it from occupied to vacant.