You are overlooking that the original code has both a transition() and a transitions() method, where only the code for the later has been provided. I was assuming that the former would choose a random transition from the hash, based on the transition probabilities. Obviously a hash is not a good data structure for this. A sorted array of arrays would allow to retrieve the original Emitter objects, and also provide for optimization of the random selection function. See the recent
topic.