在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
' _. i7 k! Y* W ask turtles with [infected?]
& d6 z) Y M; {/ B! `/ E- o: i [ ask link-neighbors with [not resistant?]6 G9 `7 W, t3 \7 W* E1 Q
[ if random-float 100 < virus-spread-chance
3 W/ i7 P1 K( g1 ^( A& e& s/ @$ O [ become-infected ] ] ]
0 Q+ b" J, G+ w$ A4 t* Y: Qend
. s O9 f H& c这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?' j' \; l3 [- O: q2 s( o: ^
to do-virus-checks
& s8 p* L' t& H2 t; x7 p* b ask turtles with [infected? and virus-check-timer = 0]: W" g) ?3 X: U3 S. q0 Y" v
[
6 B9 k: i, u: E) l: p5 j if random 100 < recovery-chance
4 M6 a8 |* V" u8 B. H, b, w [2 }; C3 A8 J& W* q- o! s
ifelse random 100 < gain-resistance-chance
* s1 f' o% f* x0 X [ become-resistant ]
/ \4 Q+ f- ~% [ [ become-susceptible ]+ ~% D$ |& i p0 Y' m9 B/ |/ ?: ~
]
+ P5 Z: Z5 j6 ~* r ]
! }/ K# T& n1 Y; y& \end) ^% K# y% Q x; ^
下面同样这个问题不明白
& e+ K1 O e/ w: u+ y+ `9 z小妹求大神帮忙!!
4 N; N' b# R- X! A1 Q |