在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus( D7 [( I% S4 N7 d2 I
ask turtles with [infected?]: I( A% Q9 q4 Q9 S+ ~3 J
[ ask link-neighbors with [not resistant?]
2 c7 E9 e" b* w' Y [ if random-float 100 < virus-spread-chance
( Y0 C" K( B+ ^: F$ ~ B [ become-infected ] ] ]
& L" d; g9 @3 M" @& F% |# iend
3 e! Q7 Q+ i6 }& [6 u$ _' g! t这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?, y7 V& ?/ B. @- I v* X: b% j5 \0 |
to do-virus-checks
4 z: a8 Q3 K& g$ p; p ask turtles with [infected? and virus-check-timer = 0], z; u2 O8 A) R- _2 _
[$ J* z7 U# p4 f6 s- \/ v1 a
if random 100 < recovery-chance
% X( a) Q' x, {( [6 K [
+ ^* E8 n' T! G) ]8 C ifelse random 100 < gain-resistance-chance
7 S' p. c- b1 t7 l [ become-resistant ]
. j* b- |* B t: {0 ?# \' L0 S [ become-susceptible ]
( l* I; b) |8 `6 g ]
: k0 o+ b- r% w# H" p( z d ]
7 e1 W9 |% s3 x8 O& nend& z/ b. v5 p) d
下面同样这个问题不明白: M8 x. _" ^" ?7 D2 w7 c2 o* a9 V3 O" W
小妹求大神帮忙!! 2 N6 A9 s1 V, i- _' U
|