After exhausting the Documentation for NetLogo online, I couldn't find a solution to set a parameter (lets call it r
), to an integer in the function declaration.
In python it is as simple as WTMC(n, r=25):
In NetLogo however, I don't know how to set r = 25, without having an error.
How can I set my WTMC [ n r ]
function to WTMC [ n r = 25 ]
So that I can then call my function: show WTMC [ n ]
, without needing to include the parameter r
Thanks in advance
Unfortunately, this isn't directly possible NetLogo. You can get close however by just making two functions:
to WTMC [ n ]
full-WTMC n 25
end
to full-WTMC [ n r ]
...
end
(In extensions, you can create primitives with optional arguments like this, just not normal netlogo)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With