phetsims / natural-selection

"Natural Selection" is an educational simulation in HTML5, by PhET Interactive Simulations
GNU General Public License v3.0
3 stars 7 forks source link

New bunnies in the Downstream sim are initially in the wrong positions. #343

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

In the State wrapper, new bunnies initially appear at incorrect positions then immediately move to their correct positions. I see this in 1.4 and master, so it's does not seem to be related to the IOType changes made in #330 and #327.

To reproduce:

  1. Run the sim in the State wrapper (in master or 1.4)
  2. Go to the Intro screen
  3. Press the "Add a Mate" button
  4. Watch the Downstream sim closely. When the generation clock reaches 12:00, new bunnies will be created. They will be in different positons than the bunnies in the Upstream sim, but will immediately jump to the correct positions.

@zepumph Is this a problem or expected behavior? Let me know if you'd like to discuss.

zepumph commented 1 year ago

This is not a bug. The state wrapper in the form you were running it has 2 sims running, unseeded (purposefully). This means that in between state sets, they will have their own internal logic running for how to create the next generation. Then what you are seeing with the "but will immediately jump to the correct positions" part of (4) is that the upstream sim state is set onto the downstream sim. Feel free to close or ask more questions.

pixelzoom commented 1 year ago

Got it, thanks for the explanation. I'll try to keep this explanation in mind the next time this behavior is reported to me by QA or another team member.