Adding a loop in a policy update function?

Hi guys! How do I create a loop in my cadCad model? I have a model where 1 month is a timestep.

I would like a state variable to increase in size after 2 years. After these 2 years the size increases once per year.

Where do I add this code? It would be in the policy update function right?

Thanks in advance for the help!

Kind regards,

Jürgen

Hi guys!

I hope you’re having an awesome week!

I came up with the following code;

def new_location(params,
substep,
state_history,
previous_state,total_population):

if substep > 24 and substep % 12 == 0:
       while substep < 80: 
        return total_population + 70000
    

return total_population + 0 

This code could help me to add more users to a state variable every 12 time steps.

Can I turn this into a policy update function? If yes, how?