For further information on the train of thought behind this recipe, please refer to Steve Rabin's book, Game AI Pro.