在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
N- Z( y9 }$ C ask turtles with [infected?]) O( V1 C, q5 Y2 a
[ ask link-neighbors with [not resistant?]
) z u+ H$ s D* W! F [ if random-float 100 < virus-spread-chance! R+ Q0 ?& t; L* s
[ become-infected ] ] ]
9 Q$ J1 ]: D" A B0 \6 N3 b& q# K; send0 V; V* T+ |7 d4 B0 E
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢? i& ?) c# W% U9 u
to do-virus-checks
0 f0 L$ L& y5 K: d7 ?# w% F1 { ask turtles with [infected? and virus-check-timer = 0]
3 ~/ e+ ~2 ~9 B: ~$ O6 y9 u) ~. v [
" P% _. T b+ N y5 B' l if random 100 < recovery-chance
0 W! c3 x1 `- D; H# ~0 y [
* R& r3 m& j+ a- x; | ifelse random 100 < gain-resistance-chance
4 O4 a! u% `- V8 s9 n Z& U, [3 N [ become-resistant ]. M E* Q+ a) [( r6 g
[ become-susceptible ]. T! h0 D, _. @/ z6 }
]
+ h/ R( L V" o: G; S* S9 ?3 I$ R ]& g5 n8 n8 ]$ y; F' ?% B: {- z
end! y! \$ Y E" A8 F
下面同样这个问题不明白
1 e" I1 q- R& P3 w小妹求大神帮忙!!
% c7 k& H c" j, e: l5 a |