如何使用 NetLogo 模拟函数的结果

How can use NetLogo to simulate the outcome of a function

假设我有一个像 Y= 0.5*a+0.23*b+0.52*c+0.3 这样的函数

a是连续变量,b和c是分类变量(如1或0)

我想创建多个代理,它们可以用不同的 b 和 c 孵化 Y 的数量(四舍五入为整数)

老实说,我是 Netlogo 的新手,对编码不是很熟悉。

用户手册的三个教程我都看完了,但还是没有头绪。

用户手册三个教程。

谢谢

这就是你说的。但我不认为这实际上是你的意思。

to testme
  clear-all
  let a 5
  let b 10
  let c 20
  let Y ceiling (0.5 * a + 0.23 * b + 0.52 * c + 0.3)
  print Y
  create-turtles Y
  [ setxy random-xcor random-ycor
  ]
end