NetLogo 两个代理集操作
我有两个代理集。是否有用于查找的函数:
- 两个中都存在的代理的代理集(交叉点)
- 一个中存在而不是另一个中存在的代理的代理集
我发现手动实现这一点非常困难,特别是当它需要在其中时三重 ask
理想的用法类似于 with
语法:
let cross set1 and-in set2
let uniq set1 with [color = red] not-in set2
简单的事情,例如“代理 A 在代理集 X 中吗?”有问题
I have two agentsets. Are there functions for finding:
- An agentset of agents that are present in both (intersection)
- An agentset of agents that are present in one and not the other
I'm finding it very difficult to implement this by hand, especially when it's needed inside of a triple ask
Ideal use would be similar to with
syntax:
let cross set1 and-in set2
let uniq set1 with [color = red] not-in set2
Simple things like "Is agent A in the agentset X?" are problematic
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于第一个,您使用
turtle-set
原语。对于第二个,您需要member?
原语,它也适用于代理集。像这样:For the first one you use the
turtle-set
primitive. For the second one you need themember?
primitive, which also works on agentsets. As such: