如何移动到 linked 代理,它对 netlogo 中的 link 具有特定值
How to move to a linked agent which has a particular value for the link in netlogo
我正在尝试 select 我 link 对我 link 具有高价值的代理商。然后,我想转到其中一个代理。我无法弄清楚如何 select 我的 link 另一端的代理,其中 link 具有特定值,然后移动到其中一个具有高值的代理0.9 用于信任连接。我怎样才能做到这一点?
此外,我已经实施了一定的机会,让代理移动到对我们 link 具有高价值的这些代理之一。这是正确的做法吗?
breed [ people ]
undirected-link-breed [ connections connection ]
connections-own [ trust ]
to setup-all-connections
ask people [setup-connection]
end
to setup-connection
create-connections-with other people [set trust 0.4]
end
to go
move-people
tick
end
to move-people
ask people [
let chance random 100
if chance < 80
[ ;80% chance to move to an agent with which our trust connection is 0.9
let highTrust my-out-connections with [trust = 0.9]
move-to one-of people with [member? other-end highTrust]
]
]
end
怎么样
let highTrust turtle-set [other-end] of my-out-connections with [trust = 0.9]
move-to one-of highTrust
即获取适当的列表 other-ends,将该列表转换为代理集,然后移动到其中一个。或者,更经济
move-to one-of [other-end] of my-out-connections with [trust = 0.9]
因为 one-of
适用于代理列表和代理集。在申请 one-of
之前,您可能需要确保他们至少是一位这样的受信任代理人。您可能还想检查在同一位置是否已经有一个受信任的代理,以便它不会离开它。
我正在尝试 select 我 link 对我 link 具有高价值的代理商。然后,我想转到其中一个代理。我无法弄清楚如何 select 我的 link 另一端的代理,其中 link 具有特定值,然后移动到其中一个具有高值的代理0.9 用于信任连接。我怎样才能做到这一点?
此外,我已经实施了一定的机会,让代理移动到对我们 link 具有高价值的这些代理之一。这是正确的做法吗?
breed [ people ]
undirected-link-breed [ connections connection ]
connections-own [ trust ]
to setup-all-connections
ask people [setup-connection]
end
to setup-connection
create-connections-with other people [set trust 0.4]
end
to go
move-people
tick
end
to move-people
ask people [
let chance random 100
if chance < 80
[ ;80% chance to move to an agent with which our trust connection is 0.9
let highTrust my-out-connections with [trust = 0.9]
move-to one-of people with [member? other-end highTrust]
]
]
end
怎么样
let highTrust turtle-set [other-end] of my-out-connections with [trust = 0.9]
move-to one-of highTrust
即获取适当的列表 other-ends,将该列表转换为代理集,然后移动到其中一个。或者,更经济
move-to one-of [other-end] of my-out-connections with [trust = 0.9]
因为 one-of
适用于代理列表和代理集。在申请 one-of
之前,您可能需要确保他们至少是一位这样的受信任代理人。您可能还想检查在同一位置是否已经有一个受信任的代理,以便它不会离开它。