If a component stored in n_other is an array, then in a MizerSim object produced by project() the stored values at all time steps happen to be equal to the values at the final time. That happens because when project() calculates the value at the next time step, it also overwrites all previously-stored values. That is due to the fact that for lists containing arrays, R only does a shallow copy of the list, not copying the arrays. So all the arrays stored at different time slots are actually just pointers to the same array, so that when that gets changed, they all get changed. To fix this, project() will need to do deep copies of the n_other list and one way to do that is to serialise and then unserialise the list.
If a component stored in
n_other
is an array, then in a MizerSim object produced byproject()
the stored values at all time steps happen to be equal to the values at the final time. That happens because whenproject()
calculates the value at the next time step, it also overwrites all previously-stored values. That is due to the fact that for lists containing arrays, R only does a shallow copy of the list, not copying the arrays. So all the arrays stored at different time slots are actually just pointers to the same array, so that when that gets changed, they all get changed. To fix this,project()
will need to do deep copies of then_other
list and one way to do that is to serialise and then unserialise the list.