Netlogo 如何让我的海龟继承其他海龟的属性
我有购物海龟和目的地海龟,我希望我的购物者将目的地海龟的属性设置为自己的属性Netlogo 如何让我的海龟继承其他海龟的属性,netlogo,Netlogo,我有购物海龟和目的地海龟,我希望我的购物者将目的地海龟的属性设置为自己的属性 ask shopper [ set destination min-one-of (turtles with [label = 789 ] in-radius (360) )[distance myself] set attribute1 [attribute of destination] set attribute2 [attribute2 of destination] s
ask shopper [
set destination min-one-of (turtles with [label = 789 ] in-radius (360) )[distance myself] set attribute1 [attribute of destination] set attribute2 [attribute2 of destination]
set last-destination "clear" ]
netlogo将海龟设置为目的地,例如,我可以面对它并改变它的颜色,但我仍然得到“无常数”。我想你只是遇到了一个括号问题。使用:
set attribute1 [ attribute1 ] of destination ; good!
而不是:
set attribute1 [attribute of destination] ; bad!
用更“正式”的NetLogo术语来说,的是一个接受两个参数的报告器:左侧的报告器块(用方括号分隔)和右侧的代理或代理集