Neil's News

Boredom and Frustration

5 March 2007

A couple of weeks ago I filed a complaint with the testing group. I said "Whenever I upload an infinite loop, it takes forever to complete." My tongue-in-cheek suggestion was that we get faster servers on the testing farm.

More generically, computers have a real problem dealing with non-winning situations. A lot of academic work is being poured into machine learning. The idea is that computers can see what works, what doesn't, and come up with new strategies. This is a complex problem; legions of PhDs have thrown their careers at it.

I think there is a simpler approach. Boredom and frustration. Today I was watching Widget deal with some sticks I gave her. She grabbed one in her mouth and ran towards her nest. For some inexplicable reason the 10cm long stick stopped suddenly when she attempted to enter the 3cm wide tunnel to her nesting box. Oh well, if you don't succeed, try again. Which she did. Again, it didn't work. After several more attempts she was clearly frustrated and changed her approach. She tried dragging the stick from one end. This worked a little better, but the stick got jammed at the first tight-radius turn. After several minutes of fighting the stick, she got bored and turned her attention to other matters.

This is behaviour one doesn't see in most computers. They will quite happily execute an infinite loop until the Sun burns out. My proposal is that the computer should periodically stand back and do a self-evaluation. What percentage of the task has been completed? If this percentage is not changing (or even declining) over a significant period of time then there's no point in grinding on. There are two options:

  1. Frustration. This technique isn't working. Try another technique if one is available. Even one that in theory should be less effective might be better (due to a special case or some bug). An interesting and cheap source for other techniques might be previous versions of the offending code in the repository.
  2. Boredom. Nothing is happening. Alternatives have failed. Bail out and devote your attention to other things.

Some systems already have these concepts implemented to a certain extent. My Roomba understands the concept of frustration. I watched it get trapped under my desk the other day, ricocheting off the boundaries in a deterministic pattern like a ball in Arkanoid. After a short period it got frustrated at the constant wall-banging and switched to wall-following mode instead. It worked and it freed itself.

The Moo environment understands the concept of boredom to a certain extent. It has a finite attention span measured in ticks. When the ticks run out, it kills the task so that other tasks can run instead.

Getting bored and frustrated is not a character flaw. When properly calibrated, it is what keeps us from doing non-productive things all day.

Gah, I just noticed that for the past two months my homepage said that I'm "an software engineer". You people are lousy proof-readers. You're all fired.

< Previous | Next >

Legal yada yada: My views do not necessarily represent those of my employer or my goldfish.