memilio
memilio copied to clipboard
Reduce use of methods of StateAgeFunction in IDE model to reduce run time
Motivation / Current Behaviour
In this issue we want to examine if it is better regarding run time to reduce the use of the methods of StateAgeFunction when solving the model. We proceed as follows. See run time results in the comments.
- Currently, whenever we calculate a sum to compute flows or compartments, we determine the support_max via the corresponding StateAgeFunction. We have observed that the StateAgeFunction is accessed a lot in simulations and this may be an issue regarding performance.
- When computing the flows, the derivative is always evaluated at the same time points. So far, we have computed the derivative in every time step. Now, we do this once at the beginning, store the results in some vector and then access this vector in each time step. Analogously, we do this for the contributions of survival functions and transition probabilities in the force of infection term.
Enhancement description
Compute the necessary support_max values once at the beginning of the simulation and store them. We want to try out if this has an impact on performance.
Additional context
No response
Checklist
- [X] Attached labels, especially loc:: or model:: labels.
- [x] Linked to project