在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
2 ^9 f9 C! q6 _4 ` ask turtles with [infected?]7 o, {+ Q* B, P: @. e4 U0 ]
[ ask link-neighbors with [not resistant?]5 @5 l5 T/ ]) _6 K8 K4 t* \8 N [- q: e
[ if random-float 100 < virus-spread-chance
/ Z! n F6 y0 F4 B# e( m7 X [ become-infected ] ] ]
3 P1 e" t9 Z9 t% send
, K _" }7 `+ R这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?/ t [/ }4 t" \6 a& x/ F: p
to do-virus-checks
/ o& m8 Z4 B# _, L- k/ ` ask turtles with [infected? and virus-check-timer = 0]
# p2 I0 d9 m1 c& |: Y$ a) K [, o1 b$ O" A* z& e, ]
if random 100 < recovery-chance* z5 R& \. h. n+ v1 P. i9 Q m
[, r' ?4 @2 M3 h' C
ifelse random 100 < gain-resistance-chance' k/ g- e; O- Q
[ become-resistant ]$ e/ l) ^2 o3 z
[ become-susceptible ]
7 R/ m% w/ y5 J2 N ]
3 p, a6 t$ r& d, Z4 l ]
1 D) f0 a8 U; |4 a- Iend3 O1 M9 n+ q+ e6 E# X# I: o" f0 T
下面同样这个问题不明白1 ~0 O! D5 U x1 s
小妹求大神帮忙!!
9 |5 O/ r/ P$ Z8 `& \4 U: H |