Algorithms for Microscopic and Macroscopic Modeling