Hi,
This post just for a technical advise. I plan to save the results of a simulation at a given month each year (of the simulation). In batch mode, I managed to do it as following (ater is a species that may count 1 to millions - theoretically- agents):
- in global:
list mapList<-nil;
reflex createMap when:myMonth=10{
add ater to: mapList;
}
- then:
experiment mybatch type:batch repeat:100 until:(time=144#month){
int countSim<-1000 update:countSim+1;
reflex save_batch{
int countSave<-5000;
loop i over: mapList{
countSave<-countSave+1;
save i to:"result"+countSim+"_"+countSave+".shp" type:"shp" crs:"EPSG:27572";
}
}
}
An it works fine (so far). To initiate countSim and counSave to 1000 and 5000 respectively is just a trick to get the files in a convenient order...( = to avoid to get 10 just after 1 after sorting; I get 1001, 1002,.... 1010)
Here is the question: in global, with this script, I create a big list which (theoretically) can reach a big size (potentially a large number of agents) and so (potentially) "eat" a lot of RAM. From this viewpoint, would be better to save the shapefile to the hard disk at each month during the simulation rather than to add each saving in a list stored in RAM and then save them to shapefiles after the end of each simulation. However, to do that, I must create file names during the simulation that include clearly the simulation number (eg countSim in the above script). Is there any variable accessible from within the simulation that would tell me what is the simulation number in progress ? Is it technically feasable?
Best,
Patrick