不同品种的不同行为

时间:2017-01-09 11:22:48

标签: communication netlogo

这是我的第一个netlogo模型,我面临一些困难

我有两种品种。我希望其中一个传播并接收一个行为,另一个接收它但不传播它。 传递行为:

to pass
  if any? other turtles-here with [good-deed?]
    [ set good-deed? true ]
end

在模型中,这只会传递其中一个品种之间的行为,我希望其他品种接受这种行为,但不要传播它。

1 个答案:

答案 0 :(得分:2)

因此,您可以使用品种命令设置不同的品种。就在顶部:

breed [spreaders spreader]
breed [non-spreaders non-spreader]

并在 go 中,只要求吊具执行传递命令。像这样:

to go
ask turtles [
   move 
   ;; etc. (whatever you want both of them to do)
  ]
ask spreaders[
   pass]

end

PS。你可以将pass命令更改为:

ask other turtles-here with [good-deed? = false][
  set good-deed? true]
相关问题