Open lesquoyb opened 2 weeks ago
I've found what generates the NPE: the flowstatus of the scope passed to createAgent
at line 500 in createSimulation
of ExperimentAgent
(see here is DISPOSE
, so in the implementation (see here) there's a test and if the scope is interrupted (which is the case if the flowStatus is DISPOSE
) the whole method returns null, which creates our NPE later.
@chapuisk you recently reworked a bit the Exploration class that is involved (see the error stack) maybe you can have a look ?
@lesquoyb What I can see first is a contradiction between your Gama preferences and what you try to do with your experiment: seems like pref_parallel_simulations_all is set to true, while you limit the number of parallel thread to one... however, I'll try to investigate more to avoid crash in that case.
Edit: don't tell me the pref is false, because your stacktrace go through it (here)
well maybe the problem is in the fetching of the parameters then because I have the default ones for parallelism:
pref_parallel_simulations_all
is false but pref_parallel_simulations
is true, maybe there's a confusion here
Ok ! can you print the pref within your experiment? are we sure that server workspace is the exact same as the GUI one? do you have the same error when parallel
facet is more than 1?
@lesquoyb can you explain further how you practically launch the experiment with the use of Gama server? so I can reproduce the issue and see what I can do !!!
Normally I run it through a python script but what you can do is start gama-server (add the parameters '-socket' followed by a port number to the headless product) then open the connector.html
file in your Web browser, toggle the server button, change port number to the one you previously gave to headless, connect, load the model (fill the path of the file and experiment namethen press load/reload) and press play
Ok ! I spotted the bug, however I don't know how we should handle it.
To state it simply: server ask experiment to step > step of the experiment is to launch batch plan (100 simulations) > returns to server testing if end condition (the one specified in batch facet until
) is met > it is not (to be clear it makes no sens in batch experiment) > step again experiment (has already done 100 simulations) > error
The part of the code responsible for this is here. A workaround could be to test if (exp.isBatch())
and do not step in that case... however it would break the repeat way to go (experiment batch step() means going to the next set of repeat). I don't know why but headless server workspace seems to have the pref_parallel_simulation_all
to true, putting it to false is another workaround (but the issue will appear if pref is changed)
Describe the bug When running a batch experiment through headless server I have a NullPointerException at the end of the first simulation of the batch:
And the whole experiment stops. The same experiment has no problem running in GUI mode.
To Reproduce Steps to reproduce the behavior:
global { bool end <- false;
}
experiment simulationBase type: batch until:end keep_simulations:true repeat:100 parallel:1 { }