在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
, ?8 f- ^: J1 V" O. w ask turtles with [infected?]
( Q f+ m" |5 x$ P! C+ ~" m [ ask link-neighbors with [not resistant?]
# c: f: W4 q4 M# S6 C. } [ if random-float 100 < virus-spread-chance
_$ P# N5 e. e- F0 | [ become-infected ] ] ]
+ P1 R8 ^. o8 g4 G$ I1 _end% _$ @& A, E2 ]5 Y0 u5 P+ y
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?+ _- K* Z k/ M8 E( l( t6 Z
to do-virus-checks; q. h5 Q6 h. v8 V
ask turtles with [infected? and virus-check-timer = 0]
/ k+ U# I2 T3 X [
0 U, D+ Q: T" ], m" a5 h+ w if random 100 < recovery-chance9 x) c) k* r. G! `0 g- e% O
[
) r5 n( B+ u/ E6 Q3 l ifelse random 100 < gain-resistance-chance, i5 [0 |0 n. B* S3 T4 o
[ become-resistant ]1 @, e% r o' @5 u% b" K
[ become-susceptible ]( _4 K! D1 [6 p$ Z# H0 G, Z
]
: C- s, w' K' Q. i' j( v7 ? ]
" N! h; w: l: U- y2 {2 @! _& xend
: Z# S# Z4 e* q' {; C0 }# x/ g6 X: b下面同样这个问题不明白
5 I |+ ^7 b" b0 H- J; q( f$ o0 j小妹求大神帮忙!! 9 K, h8 G- C) `" M4 l6 J, s8 `
|