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
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: