The protonShellPositions and neutronShellPositions arrays in ParticleNucleus are incorrectly filled in cases where the nucleons are added rapidly after one another. I believe this might be because the array positions didn't get filled with incoming nucleons yet.
Nucleons sent to an older ParticleShellPosition whose particle property should be filled because the particle property is at some point getting overwritten to null, or maybe it was never filled to begin with?
reconfigureNucleus() is getting called twice, which may be causing bugs, but this is fine on the DecayScreen where it is also called twice
The
protonShellPositions
andneutronShellPositions
arrays inParticleNucleus
are incorrectly filled in cases where the nucleons are added rapidly after one another. I believe this might be because the array positions didn't get filled with incoming nucleons yet.https://user-images.githubusercontent.com/52978048/211079555-1b376e6f-6666-4615-a7d9-c3ed4d0e9f96.mp4
In trying to track down this issue @marlitas and I found a few things:
oldNeutronCount
of 1, placing the subsequent neutron as a continuation of the proton positions i.e. in position 2particleType
toParticleShellPosition
(https://github.com/phetsims/build-a-nucleus/commit/b5a76000189d882789f484c67783cb9d186920ee)ParticleShellPosition
whose particle property should be filled because the particle property is at some point getting overwritten to null, or maybe it was never filled to begin with?reconfigureNucleus()
is getting called twice, which may be causing bugs, but this is fine on the DecayScreen where it is also called twice