在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus0 S2 d D0 f& w/ M
ask turtles with [infected?]& r, U1 Y. ^9 @& y1 @; e
[ ask link-neighbors with [not resistant?]
$ O2 a% C5 T# l/ a) \$ j [ if random-float 100 < virus-spread-chance' J, e, e, n; ^' g* S; U: |
[ become-infected ] ] ]0 [+ Q/ _# a. {1 q3 I
end
5 N5 @# K) t# Z- `1 L这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?' y Z, T; h! f: Y% V4 C0 S
to do-virus-checks: h+ c% n5 V& h
ask turtles with [infected? and virus-check-timer = 0]) g1 F7 s8 _; R9 u* b' _! d. h
[
2 y) d& Z1 z3 G( ^& Q# M2 o if random 100 < recovery-chance
$ I5 S9 O( U2 ^( b2 S: O [
1 q; _5 k, m# p: Z" t ifelse random 100 < gain-resistance-chance
( I" ^- X( C: d8 T8 h [ become-resistant ]$ e% y! j- G3 Y: p) [* q
[ become-susceptible ]8 u4 A- R1 c! D) w7 ]
]
; T. N* t) w; c# V8 C$ i ]$ y6 }& u+ w1 P% B
end* m/ Y7 m0 n. _+ f; v+ q/ ? e+ F
下面同样这个问题不明白" i" B B/ f+ \& W
小妹求大神帮忙!! + F. [. P9 h! x4 i M+ ~
|