在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
W e1 d2 n) S. O ask turtles with [infected?]
4 n8 Z% Q, N: O+ U [ ask link-neighbors with [not resistant?]( _$ ~; }6 W. G5 G0 b, q9 X
[ if random-float 100 < virus-spread-chance2 p! J+ }' I! a8 Q9 _6 O2 w
[ become-infected ] ] ]
& @7 ]0 P' Y; S; Q5 l( oend
1 o7 x/ W# h; k! h% R这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
* l) O( z! L& ]/ Xto do-virus-checks- h; l! T9 T- S5 W6 j6 o. }+ ~# C& I
ask turtles with [infected? and virus-check-timer = 0]! y: C+ I6 s8 p+ v+ ^2 I
[: o) T& _( [- l9 a. r
if random 100 < recovery-chance) s; }! G6 h0 Q2 g2 q
[8 M% Q5 R! t0 @: s( g
ifelse random 100 < gain-resistance-chance8 {; J+ ?( U% F7 {
[ become-resistant ]
7 f+ G" P! w; U5 b. z v$ n5 S6 e [ become-susceptible ]4 Y$ g7 ?1 m8 K1 S. M+ ~5 [$ M1 I
]7 p. ]+ O4 m# Q- S+ K
]
+ d8 b! a# e) C" [ E) Q- R' N) pend0 Y) u& d l; ]; }
下面同样这个问题不明白
5 S, w! G& N$ D, W$ z小妹求大神帮忙!!
3 N1 k- ]; b5 K: A& Y! Q8 } |