gama-platform / gama

Main repository for developing the 2024+ versions of GAMA
https://gama-platform.org
GNU General Public License v3.0
12 stars 5 forks source link

The return of the offer method is ignored in experiment controllers #134

Closed lesquoyb closed 3 weeks ago

lesquoyb commented 4 months ago

Describe the bug The offer method for queue objects used in multiple places in the gama code base returns a boolean to tell if an object has been successfully inserted in the queue or not (in the case of a queue already full). The problem is that it is never checked and the program acts like there is no possible error. While it makes sense in certain cases to ignore it, in the case of gama-server it is very useful to know when a command sent by the client has been added to the queue or not. Taking that into consideration would mean to change a few function signatures and probably behaviors in the experiment controllers.

Additional context In the case of gama-server there's the commands queue in AbstractExperimentController that is set to contain only 10 elements. I think we could have the size of that list as a global parameter of gama, so it could be set in function of the use of each gama-server.

It would also be wise to generally investigate the use of offer everywhere in the program because gama-server may not be the only part that would benefit from this information.

AlexisDrogoul commented 3 months ago

See commit https://github.com/gama-platform/gama/commit/3dfc74b52fed96a00cf5cc97b65de017e9dbf819