gama-platform / gama

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

Adding a warning when using a parameter statement referencing an experiment variable in a batch experiment #162

Closed lesquoyb closed 3 weeks ago

lesquoyb commented 5 months ago

Describe the bug When defining a parameter in a batch experiment, it doesn't change the value of the variable linked with the facet var if that variable is defined in the experiment, but works normally with global variables.

To Reproduce Steps to reproduce the behavior:

  1. run this code:

    experiment a type:batch until:cycle=1{
    int b;
    parameter var:b min:0 max:10;
    
    reflex e{
        write b;
    }
    }
  2. observe that b is always 0
  3. you can move the declaration of b to the global and see that its value is varying from 0 to 10 as expected
AlexisDrogoul commented 5 months ago

To be honest, this is expected: batch experiments are supposed to automate the exploration of simulation parameters, not their own parameters. A possibility could be to put a warning to explain this ?

lesquoyb commented 5 months ago

Yes I think a warning could be nice indeed

AlexisDrogoul commented 1 month ago

I have added an info popup in https://github.com/gama-platform/gama/commit/910e680a322f368c4d8d2ab3bfbd206d32541073. Please test !