You can model ‘death’ as an absorbing state, and then use simoptions.conditionalrestrictions so that all model stats ignore that ‘dead’ state. E.g.,
In principle you can just ‘delete’ the dead from the model, but this would require you to custom code the agent dist commands (as you then need to renormalize the survivors to mass one).
Note that if ‘death’ is endogenous you need to think about the ‘value’ of death versus ‘life’. If death is exogenous this is not an issue.
Also, you can model endogenous firm entry/exit explictly:
Firm’s are typically modelled as having a discount factor of 1/(1+r), where are r is their cost of borrowing. Note that any firm that aims to maximize present-value of profits will conclude that this is the right discount factor for it (otherwise you can either make more money by borrowing and investing, or by cutting investment so you can lend to others). You could do other things, and people sometimes do, but 1/(1+r) is the basic standard.
Not sure why ‘periodic disasters’ should necessarily change your discount factor (they might, but doesn’t seem necessary). If people with same discount factor expect more disasters they will act in a way that looks more present-biased from the outside (they will give up building houses if they come to expect all houses get destroyed by disasters within the decade; no need for a change in discount factor to get this behaviour).