gfrances/model-based-social-simulations — pull request #1 by gfrances (2014-09-05 15:23:34+00:00)
Title: Improve the performance of the intensive raster-copying process during the execution of the UCT algorithm

The idea is to exploit the very particular characteristics of the MDP tree exploration process (e.g. the fact that there is only one agent acting) to reduce the performance impact of the many raster copies that need to be done to preserve the correctness of the process. To that end, we implement a special type of raster that we call **MDPRaster** and which indeed only stores a smart pointer to the original raster, and individual modifications are stored in a (hopefully more manageable) map that maps raster positions to their (modified) individual value. The data structure is better documented in the [MDPRaster.hxx](https://github.com/gfrances/model-based-social-simulations/blob/MDPRasters/src/MDPRaster.hxx) file.

I've run a couple of very informal test simulations with MDP agents. The first one (10 timesteps, 50x50 grid map, 30 MDP agents with h=6 and width=1000) takes around 6min on the standard version, whereas the MDPRaster version takes around 23s, a **x 15 improvement**. The other, a simulation with 1 single MDP agent (10 timesteps, 50x50 grid map, MDP agent with h=10 and width=10000) takes 8s on the MDPRaster version, and almost 2min on the standard version, roughly the same **x 15 improvement**.