gama-platform / gama

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

Add a unit in the parameters #197

Open lesquoyb opened 1 month ago

lesquoyb commented 1 month ago

Is your request related to a problem? Please describe. Currently when defining a parameter it is expressed without unit, which can be bothering some times. Take for example the case where you use a parameter for a duration in hours in your model, you could define something like this:

model param

global {
    float my_duration <- 1#h;
}

experiment a {
    parameter "Nb hours" var:my_duration min:1#h max:10#h step:1#h;
}

The problem is that in the user interface, this is expressed in seconds as the #h is used, but from the user's point of view it should be hours. image

Describe the improvement you'd like It would be nice to have a way to add the unit in which we want the parameter to be displayed in.

Additional context There's already a facet called unit to add a text, but this doesn't make any conversion into that unit, it is more of a comment. Anyway, to my knowledge, nobody uses it and it is not even displayed by default