我有一个报告,将一个范围划分为11个步骤,如下所示:
to-report random11steps
let step random 11 + 1
let step-value (minLM / 11)
let rnd 0
repeat step [
set rnd (rnd + step-value)
]
report rnd
end
其中minLM
是设置为0.005的全局变量。当我运行程序minLM
时,更改为' 0。
如果我将minLM
替换为0.005
,则该功能有效,但我不知道为什么minLM
更改为0
。
此外,是否有任何原语使这个程序的代码更短一些?
此致
答案 0 :(得分:3)
minLM
;看别处。 minLM
作为参数。 (step * step-value)
。