在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
: h. L l- u: p% h; e, a8 x0 w ask turtles with [infected?]9 R- e- D' z+ l3 u; X. s
[ ask link-neighbors with [not resistant?]2 Y+ D3 R+ c C6 j0 Y
[ if random-float 100 < virus-spread-chance1 |- O1 Q+ E! V1 s
[ become-infected ] ] ]
* m$ `- {1 j* t0 w* o; K/ p% jend
7 d% D* ^, o1 h5 r这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
/ e$ S' P1 ` f4 ~7 Z1 Zto do-virus-checks. P( V% @# x' G1 X! Z2 v9 D; f
ask turtles with [infected? and virus-check-timer = 0]
1 l* ^6 b, d; P" x [
) ?6 B w* N! r if random 100 < recovery-chance
8 a: L# f" ^3 w! R: ~ [. C9 E4 [$ ^& b/ B2 b
ifelse random 100 < gain-resistance-chance7 \1 Y7 h% _+ K! A0 S! a; o8 C L
[ become-resistant ]4 G) U6 d" x, e7 t3 _
[ become-susceptible ]
- D& J2 b) H/ k) h) M6 G( x ]% Y, H3 \- f- ~( k( F, z
]& @* A1 S+ {5 M
end
- q6 F8 Z# m6 Y6 J! t7 v! O3 k下面同样这个问题不明白
( q, g+ ` E' Z6 }小妹求大神帮忙!! + G+ v9 ?' k8 n4 m) o+ q$ \8 m
|