在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus: |6 B# l- ^1 ~' ] n& ~
ask turtles with [infected?]
! m5 C3 |( L, |& D4 p! Q2 z( \ [ ask link-neighbors with [not resistant?]
5 b" H& W' d) ?2 @" C [ if random-float 100 < virus-spread-chance
, C8 V( E: w" p [ become-infected ] ] ], I' d9 l+ s8 I+ Z
end
% ]6 f7 s. h( K8 q$ L这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?& v, g# v& W5 e( C9 S0 B
to do-virus-checks) p7 S+ N% G K5 H( U1 M& n
ask turtles with [infected? and virus-check-timer = 0]" f7 T2 C' g$ C' g2 S. [# Q
[% J8 H \- u# T. i4 \1 ]! Z0 ^3 N
if random 100 < recovery-chance8 W4 T) A# X5 ^, Y' c
[
; i% ^! h4 c' B) N ifelse random 100 < gain-resistance-chance# W2 w# }! ~. p1 @. K
[ become-resistant ]; `. {; R: m$ a* v9 t, ~: Z
[ become-susceptible ]0 |% X/ y4 Y; x: c' e+ f3 Z
]
# C8 m3 ?* @/ U2 i ]4 h" k- q$ O S* Y
end( f) O7 T/ J" t6 R: d! F
下面同样这个问题不明白3 s- i, `1 G0 \' d
小妹求大神帮忙!!
: G9 j8 z5 E. C$ P |