A priority queue (in heap.h) is used to keep the next event ready in the emulator loop. Additionally, a list of dirty channels is keept to limit the complexity of the propagation and emit phases.