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

Engine's implementation of Simulation.goToStep not functioning correctly when called in FXUI #568

Open
Vuksaa opened this issue Oct 10, 2020 · 0 comments

Comments

@Vuksaa
Copy link
Contributor

Vuksaa commented Oct 10, 2020

The implementation of goToStep could be bugged. The way it is currently called by the FXUI produces some odd behaviours.
To observe the issue:

  1. Start a simulation with the -fxui flag.
  2. Play the simulation briefly, then pause it.
  3. Press the key corresponding to the "one step forward" action - this calls goToStep and passes it the current step + 1.
  4. The simulation does not move forward one step; instead, now the play/pause feature will move one step ahead, and occasionally crash the simulation.

I remember this specific sequence of actions was working as intended back when I implemented it in the FXUI, I'm not sure if it's an issue in how the FXUI calls goToStep or if the functionality of goToStep was changed. If it's the former, I can attempt to fix it through a PR, though I already tried tweaking it and couldn't get it right.

On a side note, the implementation in Engine.goToStep is different than what is documented in the javadoc for Simulation.goToStep:

  • in Engine, it attempts to pause the simulation when the current step is higher than the given argument.
  • in Simulation, it is described as if it executes a number of steps given as argument instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant