在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
! l4 g) u+ a- F( p2 A B- w ask turtles with [infected?]
" [6 h; p: w# R [ ask link-neighbors with [not resistant?]. j" J, t% j9 K S' ?9 f$ ^
[ if random-float 100 < virus-spread-chance
$ I# k6 o+ C( ]+ ~; I$ e [ become-infected ] ] ]
! z, U: f5 M: q* P9 Lend
" X4 }9 ^; F, \9 l/ `) a1 h, t这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
( p2 ^% U# C% I# wto do-virus-checks0 C5 ~' z$ x6 A+ }( r6 V
ask turtles with [infected? and virus-check-timer = 0]2 c2 l! O; P# Y" c
[5 s. c t, C9 ^ X0 D6 Z
if random 100 < recovery-chance
' e) s6 N7 o. d. x% E: _ [
- q; T; w+ P) ~/ g+ C3 [: ] C ifelse random 100 < gain-resistance-chance5 {4 C7 u$ n5 {
[ become-resistant ]& W @! [$ z7 y2 |/ j
[ become-susceptible ]
4 Z1 H3 _5 B. Y+ O, e ]+ t& b D9 a$ h4 Q
]
7 C* L* t$ G |% u; p! w& ]end& } Q5 J- x' e- \, {
下面同样这个问题不明白0 h7 b4 S! i# ^. w6 Y
小妹求大神帮忙!!
7 p- L1 T9 P* N0 z% L |