2016-10-09 3 views
0

특정 링크의 유형을 너무 비활성으로 변경하려면 다음 오류를 나타내는 다음 코드를 사용하려고합니다. 당신이하고있는 당신의 사람이링크 종류를 변경하려면 어떻게해야합니까?

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 

Error: There is already a INACTIVE-LINK with endpoints node 75 and node 28 error while inactive-link 75 28 running SET called by procedure LINK-NETWORK

called by procedure SETUP-NODES

called by procedure SETUP

called by Button 'setup'

+0

설치 노드 절차 코드를 게시 할 수 있습니까? 그러면 실제 문제를 발견 할 수있는 힌트를 얻을 수 있습니다. –

답변

0

그냥, 그것을 위해 문의하시기 바랍니다 코드를 도와 수 :

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 

을하지만 이미 링크가있을 때 작동하지 않을 새로운 품종을 가진 거북 사이.

관련 문제