在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
7 }0 Y, {1 }9 F. \ ask turtles with [infected?]1 \* ^, d$ P" }9 I
[ ask link-neighbors with [not resistant?]$ ]4 B3 z, z+ G% O8 Q2 u
[ if random-float 100 < virus-spread-chance
1 R2 J" Y( q8 A) A [ become-infected ] ] ]
: L) l2 s$ O/ bend
( z1 q% |- N9 m) m" J8 u* [这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
! G7 \# J4 c% Rto do-virus-checks I/ l6 R" y) T. T4 \2 c/ S
ask turtles with [infected? and virus-check-timer = 0]9 ]; a- |! B2 ~% U( {
[
: y7 s P& W! n- g* s- o if random 100 < recovery-chance
& q" N$ [/ A. S0 \ [
* f( }/ t2 Z5 P7 h' e9 [9 y ifelse random 100 < gain-resistance-chance1 n6 u& X: E C; P& k4 g: G5 x( A
[ become-resistant ]
: I r/ ?! _- J% V- i1 t1 C [ become-susceptible ]+ `2 n' Z3 [& {
]
m A; g$ _1 G ]
9 B* ?' p9 E' Q# d- {/ p2 d7 [- f' _7 Qend
+ ?) w" D. F+ O2 i下面同样这个问题不明白
2 q1 H8 N& U; p7 j, B# z& y9 ]小妹求大神帮忙!! / J4 j3 K0 t: g, b7 R& \/ y
|