这里我想改变品种的某些链接太不活跃,我试图使用下面的代码显示下面描述的错误。你们谁能帮我弄一下代码吗?
directed-link-breed [active-links active-link]
directed-link-breed [inactive-links inactive-link]
to link-network
ask nodes
[
create-active-links-to other nodes
[
let num-links count links
let link-freq round (num-links * link-chance / 100)
ask n-of link-freq links
[
set breed inactive-links
hide-link
]
]
]
layout
end
to layout
repeat 10 [layout-spring nodes links 0.2 5 0.1 ]
display
end
错误:已经存在一个端点为75和的INACTIVE-LINK运行SET时出现错误过程LINK-NETWORK
程序SETUP-NODES调用的 程序SETUP调用被Button 'setup'调用
就像你现在做的那样要求它:
undirected-link-breed [alinks alink]
undirected-link-breed [blinks blink]
to test
ca
crt 2
ask turtle 0 [create-alink-with turtle 1]
ask alink 0 1 [set breed blinks]
show blink 0 1
end
但是,当拥有新品种的海龟之间已经存在联系时,这将不起作用。