Netlogo: how to register the tick-advance counter as a variable?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Netlogo: how to register the tick-advance counter as a variable?



I would like to register the tick-advance counter as a variable and use it for calculation in mathematical formulas, for example, (A + B) * tickadvance. However, Netlogo seems to be unable to register the tick-advance counter as a variable. Below is a sample syntax where "Expected reporter" error has been issued. This does not go well.


globals [tickadvance example-f]
;Omission;
set tickadvance (tick-advance 0.001) ;"Expected reporter" is occurring with this syntax.
set example-f ((A + B) * tickadvance)



Any advice?




2 Answers
2



You need to do it the other way around. In setup you can include set tickadvance 0.001, and then in your code, you can call tick-advance tickadvance.


setup


set tickadvance 0.001


tick-advance tickadvance



Alternatively, if you really just want ticks, see the answer of @JensB.


ticks



If you are simply wanting the value of the counter, then you just need ticks (that is, tick is the command to advance the counter, and ticks reports the current value of the counter, note the s at the end)


ticks


tick


ticks






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard