In the discussion on constants in code we had the question whether it should be allowed to change the value of a constant or parameter afterwards.
It should be possible to control parameters (and measured constants) from BehaviorSpace. There are possibly more use cases where one would want to change the value of a parameter.
While thinking about this question, it occurred to me that the distinction should be between setting up the model and running the model after setup.
It can make sense to change a parameter (early) during setup, but changing a parameter (even a slider) after the simulation has really started should be considered bad practice.
This is related to a discussion (https://github.com/NetLogo/NetLogo/issues/2636) in NetLogo’s github issues list.
Should resize-world reset the tick counter or not?
If we turn it around, we could argue that it does make sense changing world dimensions (and topology) during setup, but not afterwards.
So, it would be nice if NetLogo allows some operations only during setup.
As far as I see, there is only one reasonable way to make the distinction: check whether the tick counter has started or not; like the corresponding option for button widgets.
This is not waterthight, but good enough for the vast majority of models.
Actions that would fall in this category would be:
resize-worldandset-topology- maybe
set-default-shape - maybe
set-current-directory - assigning a value to a constant or parameter
hubnet-reset(but this is special anyway)- … anything I missed …