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

After the simulation is killed, experiment cycle is not correctly reported in the status bar #273

Closed
lesquoyb opened this issue Jul 31, 2024 · 2 comments
Assignees
Labels
About Runtime & Simulations Concerns the way simulations are being executed 😱 Bug The issue reveals a bug in GAMA 👍 Fix to be tested

Comments

@lesquoyb
Copy link
Contributor

lesquoyb commented Jul 31, 2024

Describe the bug
I noticed n some models that are not resource intensive, the cycle written in the status bar is not consistent with the cycle the model should have written nor with the actual cycle returned by writing cycle in the interactive console, for example here with a model that should have stopped at cycle 100, I have 3 different values for cycle:
image

To Reproduce
Steps to reproduce the behavior:

  1. run this model:
model cycles

global {
	
	reflex y {
		write "hello";
	}
	
	reflex end when:cycle = 100 {
		do die;
	}
}

experiment a;
  1. See error

Expected behavior
The cycle in the status bar, in the foldable menu of the status bar and in the interactive console are the same.

@lesquoyb lesquoyb added the 😱 Bug The issue reveals a bug in GAMA label Jul 31, 2024
@AlexisDrogoul AlexisDrogoul added the About Runtime & Simulations Concerns the way simulations are being executed label Aug 31, 2024
@AlexisDrogoul
Copy link
Member

The bug is not where you think it is. What we see here is a behavior (side effect) due to the existence of cycle in both simulation and experiment. You can try by replacing do die; by do pause; and you'll see the UI stop at a correct number, and you'll be interacting with the correct agent (i.e. the simulation) in the interactive console.

To summarize: when you kill the simulation, only the experiment remains, and it has nothing else to do than running at full speed indefinitely, hence the high numbers reported (because the experiment is the only top-level agent remaining).

The trick is that it continues running, but we can't see it. For an unknown reason, the update of the status bar is not done. But if you open and close the menu (or type cycle several times), you will see the numbers changing.

So the issue is more on the refresh of the UI (which is blocked for some reason) than on the actual cycles within the simulation. I will update the title.

@AlexisDrogoul AlexisDrogoul self-assigned this Sep 2, 2024
@AlexisDrogoul AlexisDrogoul changed the title Experiment cycle continues after the simulation is killed After the simulation is killed, experiment cycle is not correctly reported in the status bar Sep 2, 2024
@AlexisDrogoul
Copy link
Member

Should be fixed by 7a4fcee. Please test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
About Runtime & Simulations Concerns the way simulations are being executed 😱 Bug The issue reveals a bug in GAMA 👍 Fix to be tested
Projects
None yet
Development

No branches or pull requests

2 participants