在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus/ u7 K' `0 A6 l8 T4 l
ask turtles with [infected?]# f/ c+ H* q, s2 M* i% W8 L. m
[ ask link-neighbors with [not resistant?]
T0 _" o. K, ~4 K [ if random-float 100 < virus-spread-chance
7 j) o( q4 a0 K" |, ^ [ become-infected ] ] ]
4 X1 m$ ], e0 L* d8 o9 N! w0 [end
* ^) [3 D- v+ x4 m2 n0 }这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?/ k3 R4 d3 K3 f# K, f( }" q; B
to do-virus-checks
8 ~5 o l. d& o ask turtles with [infected? and virus-check-timer = 0]6 l( e% t; z6 l" O) j# I. U6 G
[. j$ I; V" {* }1 K: o) W. n
if random 100 < recovery-chance' b% n! B7 G: r: z, i' n
[
C- [' b8 z1 x9 c, P, ?5 ~ ifelse random 100 < gain-resistance-chance
& ^. r2 J* h! Y# Z4 ~, g0 F6 V [ become-resistant ]4 f% n$ F1 b+ H v; y
[ become-susceptible ]
. |7 ^+ ~+ `1 } ]
3 I/ ]$ x% V" J! o ]% S& V) \5 q$ m! p. ~
end
" I4 ]3 a" X- P8 g% p+ n下面同样这个问题不明白4 I6 K0 M& S: I
小妹求大神帮忙!!
& v" J1 ~; h% b m" k |