Added particle simulation based on the events and priority queue.
Fixed some errors in the particle simulator