NetLogo - setting a parameter to an integer

Setting a function parameter to an integer in NetLogo

After exhausting the documentation for NetLogo on the Internet, I could not find a solution to set the parameter (allows calling it r) an integer in the function declaration.

In python, it is as simple as WTMC(n, r=25):

In NetLogo, however, I do not know how to set r = 25 without having an error.

How to set the function WTMC [ n r ]toWTMC [ n r = 25 ]

So that I can then call my function:, show WTMC [ n ]without having to enable the parameterr

Thanks in advance

+4
source share
1 answer

, NetLogo. , :

to WTMC [ n ]
  full-WTMC n 25
end

to full-WTMC [ n r ]
  ...
end

( , netlogo)

+3

Source: https://habr.com/ru/post/1529461/


All Articles