code: def _selectTransition(self, allocentricLocation, objectDict, visitCounts):
      
  
      candidates = list(transition
                        for transition in self.transitions.keys()
                        if (allocentricLocation[0] + transition[0],
                            allocentricLocation[1] + transition[1]) in objectDict)
      random.shuffle(candidates)
  
      selectedVisitCount = None
      selectedTransition = None
      selectedAllocentricLocation = None
  
      for transition in candidates:
        candidateLocation = (allocentricLocation[0] + transition[0],
                             allocentricLocation[1] + transition[1])
  
        if (selectedVisitCount is None or
            visitCounts[candidateLocation] < selectedVisitCount):
          selectedVisitCount = visitCounts[candidateLocation]
          selectedTransition = transition
          selectedAllocentricLocation = candidateLocation
  
      return selectedAllocentricLocation, selectedTransition
docs: Choose the transition that lands us in the location we've touched the least
      often. Break ties randomly, i.e. choose the first candidate in a shuffled
      list.