Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other components at all time steps are always equal to final time step #285

Closed
gustavdelius opened this issue Dec 26, 2023 · 0 comments
Closed
Labels
bug core Issue relates to the mizer core

Comments

@gustavdelius
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core Issue relates to the mizer core
Projects
None yet
Development

No branches or pull requests

1 participant