The Elevator Ant
I'd like to thank Alex for providing the first non-Claire guest article,
also not in his mother-tongue. For shame! everybody else
Guest Blogger: Alex Marginet
Declan and I met at work for the first time and we often tended to skew our
conversations toward our territory, of software development. It is interesting
to see how bright one’s face can become while discussing a new software
technique, algorithm or programming language properties. I saw this kind of
face once, when Declan was preparing his jump to Germany in 2016. He was about
to be interviewed by a company in Hamburg and had an assignment to be
submitted before flying there. It is very common these days to receive an
exercise and a deadline. Thus, the candidate has the opportunity to show
his/her skills and the recruiting committee can find out many interesting
facts about the candidate’s skills, mental processes and personality. Declan’s
assignment was a variation of the famous travelling salesman problem
applied to trains, stations and routes. Basically the problem is, given a
series of places on a map, a start point and a destination, find the shortest
path where the salesman has visited all the points. “Shortest” can be viewed
from several points of view; distance, time, CO2 emissions, number of pubs…
The idea is to find the optimal vector of performance. He did a brilliant job
with his assignment and had very clear ideas about best approaches to the
problem. Then, one afternoon, while discussing this topic, we started looking
deeper at some of the
“ant colony optimisation” algorithms. I remember myself being amazed with the new world that we were discovering
and I could see that brightness in Declan’s face. I don’t remember if he was
hired or what was the outcome of all that, but that afternoon was sublime for
me.
Ants are very interesting animals, especially from the social point of view.
They rarely behave as individuals, looking for their individual benefit, but
usually as part of a colony and working toward a common goal. I do not know
what is the world's vision of an ant and maybe they are also acting out of
pure self interest (i.e. instinct) that, from our super scale point of view
results in what we perceive. Anyway, their patterns for collaboration may be
very helpful if we adapt and reproduce them to solve our human problems.
Recently, Declan wrote an
article about
elevators and I started researching how to prepare for interviews. I am
amazed about how things work together, like ants do, to put a topic in front
of me over and over. It turns out that many companies are using the amazing
Elevator Saga game, created by
Magnus Wolffelt, as an interview tool.
I must admit that it is one of the best resources I have ever seen. It can be
used for all programming skills. Basically, it consists of a programming
interface where the candidate has to implement the software for a set of
elevators in different buildings and transport a minimum number of people in a
defined period of time. Every level is defined by a building with different
floors, number of elevators, and goal. The programmer will then add code and
run it and will see how that code performs. While playing with it, I
discovered that elevator’s software are very complex and there are many
factors that can be improved to get to the optimal performance. After talking
to Declan and reading his article, I discovered that the most restrictive
parameters or bottlenecks are the users -as usual- and how to influence their
behaviour. If we think of elevators as closed systems with only one or two
inputs and outputs we will end up with the traditional systems, where users
wait for ages and efficiency is far from optimal. We need more inputs and more
outputs. If we think about other systems, elevators' interfaces are quite
primitive in comparison. These are some of my proposals to improve those
interfaces:
- Disabled Call buttons
- Call buttons with destination floor
- Cancel call button
- Indicator of elevator to serve order
- Use of ant colony algorithms
Obviously, I am thinking of systems involving several elevators with
certain customer traffic.
For single-elevator buildings the problem is very different and it can only be
improved from the behavioural point of view. The idea is to provide a console
on each floor, using modern interface, where the customer enters the
destination floor, it is very important that this interface has “cancel”
functionality, because we, as users, make mistakes, even when there are two
buttons, up and down. After entering the destination floor, the interface
should immediately display which elevator has been scheduled to serve the
request. The user will wait in front of the elevator that will serve his/her
request. Once inside the elevator, no console is available because the order
is already queued. Safe and secure buttons are required, to prevent the
gratuity of use, I would introduce an artificial delay in serving short
distance requests. Let’s say you are on 7th floor and enter 6th floor on the
interface, then the system should schedule this order to the end of the worst
possible queue, after finishing serving all the rest of scheduled tasks, and
also making up a delay if needed. This would discourage most of the users from
using elevators for shorter distances. One exception to this is the “disabled”
call button. It works in the opposite way: once the disabled button is
pressed, the order will be pushed as the next immediate command to serve for
the closest elevator. Obviously, this button would only work when all the
customers behave civilly. Finally, the use of the ant colony algorithms would
help to find the optimal serving order for each elevator. Depending on the
system’s size, path calculation using brute force is almost impossible, and
here is where ant colony patterns excel.
Our daily life is often like an elevator set: we want to serve many things at
the same time by just using our brute force, we do not pay attention to what
is important for us, the part of us deserving more attention, if serving
stupid request will make us more inefficient, why move at such pace. In any
case, I believe that the best way to face those issues is by forgetting about
the human way, and being more collaborative as ants are.
Comments
Post a Comment