There were some major issues in the previous version that were stopping things from moving forward. In essense, the individual-based simulation code became unwieldy and badly organised, making it hard to identify bugs. The use of the Rcpp package was also starting to slow down development due to lengthy compile times.
This hard reset is a radical solution! But has some advantages:
migrated from Rcpp to cpp11 package, which is lightweight and faster to compile
changed coding approach for the individual-based simulator away from trying to avoid loops, e.g. by scheduling events, and towards stable memory use and generally allowing the compiler more freedom to optimise. Even if this made code slower it would be worth it, because avoiding clever sampling tricks makes code easier to interpret, but in fact I think this has also made the code faster.
More structure in classing things out. This avoids bulky functions that are hard to debug and leads to more easily interpretable and debugabble code.
In making these changes I identified some bugs that were present in the previous code base that would have been very hard to find. The new code also appears to be somewhat faster than the previous. There are many parts still missing compared to the original code base, and these need to be carefully reintroduced going forwards.
There were some major issues in the previous version that were stopping things from moving forward. In essense, the individual-based simulation code became unwieldy and badly organised, making it hard to identify bugs. The use of the Rcpp package was also starting to slow down development due to lengthy compile times.
This hard reset is a radical solution! But has some advantages:
In making these changes I identified some bugs that were present in the previous code base that would have been very hard to find. The new code also appears to be somewhat faster than the previous. There are many parts still missing compared to the original code base, and these need to be carefully reintroduced going forwards.