在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
4 j) A4 T4 H' S% v0 n; F ask turtles with [infected?]
# D" t. W( O& q. r% `! h6 ?4 i [ ask link-neighbors with [not resistant?]; }- z' J; P+ s! O9 u/ V
[ if random-float 100 < virus-spread-chance* E. C) J* l- ~6 Q$ d0 x: b
[ become-infected ] ] ], P" ^) r6 s; A$ q5 m; W* t; B. g
end7 C- v- u* @% q& Q0 O& F9 ]
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?2 v" S# P( W1 f4 J- d/ f$ A$ o# ~
to do-virus-checks6 ?! v- | s1 u6 ?6 M& d' s
ask turtles with [infected? and virus-check-timer = 0]
& d8 m. h; y: n, s/ d. K [' }% b: m* M. t, `) p
if random 100 < recovery-chance( S: L! G1 z- I) V! d
[- {2 O$ [: x. H5 Z% X3 F; A3 a
ifelse random 100 < gain-resistance-chance4 U+ R$ s' c2 a6 G
[ become-resistant ]
9 Y$ z5 d {7 `$ { [ become-susceptible ]
: J0 Q6 Q4 b, J! G* Z" h2 W ]
! A1 o5 L& L) j/ m% s7 f ]$ A* |( ]5 @& ?( w( K. a X0 L
end
; s% _8 V2 M0 \# a下面同样这个问题不明白
3 I! |. V5 R8 o8 ?8 W1 |2 {8 }小妹求大神帮忙!! 7 r R8 z/ ~4 e! t
|