我如何让我的乌龟继承其他海龟的属性

时间:2018-02-06 09:48:41

标签: 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] 
        set last-destination "clear" ]

netlogo将乌龟设置为目的地,我可以面对它并改变其颜色,例如,但我仍然得到“不恒定”。

1 个答案:

答案 0 :(得分:3)

我认为你只是有一个支架问题。使用:

SELECT Min(VALUE)
FROM (
    SELECT Col1, Col2, Col3...
    FROM YourTable

) t
UNPIVOT (VALUE FOR ITEM IN (Col1, Col2, Col3...)) u
WHERE VALUE != 0

而不是:

set attribute1 [ attribute1 ] of destination ; good!

把它放在更多"正式" NetLogo术语set attribute1 [attribute of destination] ; bad! 是一个记者,它带有两个参数:左侧的记者块(由方括号分隔)和右侧的代理或代理集。