PriorityQueue based simulation written in Java