You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment we make a TimeStepTable (or whatever Table) with every time-step for each organ that has a ModelList. This is fine when we have few organs and variables, but the number of values can grow very rapidly with e.g. an FSPM that predicts growth and yield ( e.g. > 20 variables per organ x # time-steps x number of organs).
This occupies a lot of un-necessary memory because many variables are not needed for output (so no need to keep every values of each time-step), and makes the computation slow for two cases:
as the plant grows, new organs are emitted, and each time the complete TimeStepTable is copied
when models need values from other models, we get the whole TimeStepTable, so we need to index again to get the right time-step. This is not ideal.
A solution would be to replace the TimeStepTable by another struct called e.g. SparseTimeStepTable, that would have a single Status with vector of values for some variables, but that would appear as a single value because we would keep track of the current time-step, and the value of the dynamic variables would always seem like a single value because we would index the vector by the time-step.
The text was updated successfully, but these errors were encountered:
Or maybe use Observables ? There are several packages, more or less efficient (see e.g. Rocket.jl I think?). And each time the value is updated, push to a (pre-allocated) vector of values ? Test both and choose the most efficient. The good thing with this one is that it is easy to put the vectors somewhere accessible for the user to get after the simulation.
This is fixed in #51 by using only one status per node, that is eventually updated each time-step, and the value for some variables are saved dynamically if required by the user. So only some variables grow dynamically now, not all.
At the moment we make a TimeStepTable (or whatever Table) with every time-step for each organ that has a
ModelList
. This is fine when we have few organs and variables, but the number of values can grow very rapidly with e.g. an FSPM that predicts growth and yield ( e.g. > 20 variables per organ x # time-steps x number of organs).This occupies a lot of un-necessary memory because many variables are not needed for output (so no need to keep every values of each time-step), and makes the computation slow for two cases:
TimeStepTable
is copiedTimeStepTable
, so we need to index again to get the right time-step. This is not ideal.A solution would be to replace the
TimeStepTable
by another struct called e.g.SparseTimeStepTable
, that would have a singleStatus
with vector of values for some variables, but that would appear as a single value because we would keep track of the current time-step, and the value of the dynamic variables would always seem like a single value because we would index the vector by the time-step.The text was updated successfully, but these errors were encountered: