FLAMEGPU2 icon indicating copy to clipboard operation
FLAMEGPU2 copied to clipboard

Visualiser: Begin Paused v2

Open Robadob opened this issue 1 year ago • 3 comments

Tweaks visualiser begin paused behaviour, so that it begins paused on the first step with agents.

The changes so far, cause it to pause the step after agents are created (if created in a step function).

The problem is twofold:

  • when stepExitConditions() triggers buffer update, for some reason it passes step_count+1.
  • It actually pauses on the next iteration (hence at the end of step 11), however before new buffer data has been passed (as that's where the pause mutex gets stuck).

Looking at git blame, the +1 occurred with this commit from @ptheywood, where step count update was moved to the end of step.

So not sure whether it wants to be removed or not, needs discussion.

Closes https://github.com/FLAMEGPU/FLAMEGPU2-visualiser/issues/122

Robadob avatar Mar 25 '23 19:03 Robadob

From that commit, looks like that change was to maintain the same value as before, while moving the step_count incrementing (deleted from line 73), so that the step_count is the last thing updated within the step method, making the the value is "correct" within an exit condtion.

This shouldn't have changed the value output to during the vis at all. It just means the timestep shown in the UI is the time after the current step, not the start of the current step. Removing the +1 would probably work, but then it would show 0 before step 0 has executed (if this would ever actually be visible) and at the end of step 0.

ptheywood avatar Apr 21 '23 10:04 ptheywood

I honestly don't see the value in pausing before agents. But sure, will get around to it when I have time, need to remind myself of all these changes.

Robadob avatar Apr 21 '23 10:04 Robadob

Yes, grand scheme it's unintersting and I'm being pedantic, but for e.g. recording a video of a rate-limtied simulation it might be of interest.

I don't think it's an urgent need, as there's a known workaround, so just a docblock change so the method is clearly described as pausing on the first iterations agnets are present would be fine for the immediate future.

Unsure if removing the two +1 being passed to the vis would cause other issues, or if it would just change the number shown.

ptheywood avatar Apr 21 '23 10:04 ptheywood