Caching functions that update rasters frequently

Skip to first unread message

Tati Micheletti

Apr 25, 2018, 10:55:42 PM4/25/18
to SpaDES Users
Dear SpaDERS,

Regarding caching functions (i.e. raster::mask) that update frequently (say every year) the same raster object (i.e. vegMap):

1. Will cache know that information inside the object changed every year (but not the name)? 
2. Will it keep track of each year's raster so if the simulation is run again (i.e. if it doesn't have any random call) it will quickly produce the rasters?

Thanks a lot!


May 3, 2018, 11:43:53 AM5/3/18
to SpaDES Users
I believe the answer to your questions is that, as long as the data inside the arguments needed for the cached functions changes, Cache will re-run the fucntion and update the results.
So in the case you presented, if the said vegetation map is indeed always going to be updated every time the event is computed, then caching will not do much because data is constantly changing...
Reply all
Reply to author
0 new messages