在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
) r& W: B( _! o4 ^7 E/ u. P/ ~ ask turtles with [infected?]* J/ S# i- O) U; U: [; A
[ ask link-neighbors with [not resistant?]
6 S+ H( y( y3 Q( ]1 M3 N M [ if random-float 100 < virus-spread-chance
% j6 ?; t5 e0 x6 m# Y1 ~ [ become-infected ] ] ]
( i: u8 C2 V9 i* }+ E' c Iend, U$ M5 K7 |. X6 @. [
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?4 q, A o- c0 ^7 M: f
to do-virus-checks
1 q Z/ s+ R# z! m ask turtles with [infected? and virus-check-timer = 0]
9 d0 k5 D0 L! T8 c% L! `3 O [
& B; p1 I _: N5 }1 d6 t) z if random 100 < recovery-chance( P2 b6 Q1 y, c; C, t2 E
[
4 z& n) s/ Q- V1 i) _0 T ifelse random 100 < gain-resistance-chance! n5 A: b2 h; z4 ~: v6 I( B
[ become-resistant ]
% K. D2 z& M# F7 f* {1 Y! ?' o [ become-susceptible ]
% G, f- f/ M2 q8 o& H- l ]
/ H# l/ ^; R0 { ]
& W6 ~# P0 u7 I2 mend
0 ]4 r) t4 B) s0 W Z* \下面同样这个问题不明白
* [- B. ]* b6 A2 d小妹求大神帮忙!!
. n9 P8 ^: W7 T |