Netlogo 向海龟询问链路另一端的最小变量

Netlogo 向海龟询问链路另一端的最小变量,netlogo,Netlogo,我目前正在处理一个问题,我有两个代理集:买家和卖家,卖家与买家关联。我的问题是:如何要求买方选择卖方变量(价格)的最小值 我想我可以通过原语来实现,比如: ask buyers with [count my-in-links > 1][ min-one-of price of other-end ;; something like this, this don't work obviously just wanted to show you my idea. ] 或: 使用[c

我目前正在处理一个问题,我有两个代理集:买家和卖家,卖家与买家关联。我的问题是:如何要求买方选择卖方变量(价格)的最小值

我想我可以通过原语来实现,比如:

ask buyers with [count my-in-links > 1][
    min-one-of price of other-end ;; something like this, this don't work obviously just wanted to show you my idea.
]
或:

使用[count my in links>1]询问买家[
如果链路内邻居的最小一个链路内邻居价格<1[
设置颜色为黄色
]
]

谢谢。

我想你需要这样的东西:

... min-one-of in-link-neighbors [price]
e、 例如,如果您想将最便宜的卖家作为代理存储在变量中:

ask buyers with [count my-in-links > 1][
  let cheapest-seller min-one-of in-link-neighbors [price]
]
ask buyers with [count my-in-links > 1][
  let cheapest-price [price] of min-one-of in-link-neighbors [price]
]
或者您可以直接访问此卖家的价格,例如将其存储在变量中:

ask buyers with [count my-in-links > 1][
  let cheapest-seller min-one-of in-link-neighbors [price]
]
ask buyers with [count my-in-links > 1][
  let cheapest-price [price] of min-one-of in-link-neighbors [price]
]