Random Network Example: hangs when too many links
Closed this issue · 0 comments
nicolaspayette commented
At https://groups.google.com/forum/#!topic/netlogo-devel/XSbKq3_ec5w, Alan Isaac says:
In the Random Network Example, it is easy for the naive user to set
num-links
too high, producing an infinite loop insetup-simple-random
.Two possible solutions:
i. set the
Maximum
tonum-nodes * (num-nodes - 1) / 2
in thenum-links
slider.ii. add the following (or equivalent) before the while loop in
setup-simple-random
:`let max-links num-nodes * (num-nodes - 1) / 2` `if (num-links > max-links) [set num-links max-links]`