Best way to have parameters changing over time #2758
-
Hi, I am wondering (as I have not encountered this really in any of the mesa examples I have seen) if there is a built-in or easily accessible way to have parameters that change over time through the model run. For example, if I am running a model where one of the parameters is a pollution rate, and I want to set it so that it is 0.1 for the first 250 model steps and then 0.2 for the remainder of the time, is there a simple way to do this in mesa? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, a simple way that you could do this would be to use the |
Beta Was this translation helpful? Give feedback.
Hey, a simple way that you could do this would be to use the
model.steps()
attribute : it gives you access to the current step of the model, and simply make an if condition with this.If you want to access the steps in your agent class, you can simply use
agent.model.steps()
!You can check out the precise model documentation at https://mesa.readthedocs.io/latest/apis/model.html#mesa.model.Model