You are here

Evaluation order of mortality and reproduction in submodel

Hi there,

Does anyone know in what order reproduction and destruction/mortality is evaluated if you do an individual-based model using the submodel module in Simile? In general in discrete time models the order in which the two are evaluated matters, so I was just wondering... And is there any way to specify the order in which they are evaluated? Also can you get the population size only by using a dummy variable one and then calculating sum({one})? Or is the number of instances of a certain submodel perhaps also stored in some system variable? That would undoubtedly be more elegant, no? 

cheers,

Tom Wenseleers

Forums: 

OK, the mortality is done before reproduction (in fact before any model calculations), but it uses the value of the mortality symbol from the previous time step. So it the mortality symbol has a value of 1, you will still see new individuals at the end of the time step but they will not get the chance to reproduce themselves. This order cannot be changed because these operations have to come at certain points in the sequence of actions Simile does to set values in a new submodel instance.

You can use count({x}) to get the number of items in an array or list, and hence a population's membership, thus saving you from having a separate variable with value 1 simply to sum them. But note that the creation and immigration symbols are common to all submodel instances.