在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
6 q5 @) Z( c5 Z5 L0 `( b6 i2 O+ ^ ask turtles with [infected?]
6 y _" }, t- m! W/ `& g- r( ~- b% N# v [ ask link-neighbors with [not resistant?]
" \+ { m6 Z. ] [ if random-float 100 < virus-spread-chance4 k: Z0 e; m6 a0 {" A" M
[ become-infected ] ] ]: ]0 G4 I: H* i7 i4 g- I! g) [- I
end
1 b- k) L/ u% [8 K/ L6 ` i这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
0 @" Y3 C) e, K5 y8 Wto do-virus-checks! Z% _! b( g8 x( R+ c
ask turtles with [infected? and virus-check-timer = 0]0 R7 Z' D: q( X& r1 ^
[ ]2 \! ~- m6 v! G, C+ t
if random 100 < recovery-chance
_0 _$ X& I9 X- A [
. B& Y( g, q* M: n( F ifelse random 100 < gain-resistance-chance& r# D) H9 i" O9 s6 h0 _
[ become-resistant ]7 E# ^$ T8 r+ x7 K
[ become-susceptible ]
1 F- k5 o) M3 i9 Q1 l$ G ]* B6 Y4 W- v+ g6 ^
]! S3 i: B4 t$ `0 K) y5 P$ X
end
* s- {6 Z+ U" @0 |% k0 z下面同样这个问题不明白
$ B3 P% S: n# O小妹求大神帮忙!!
- `( ^/ b. }0 ~ e& U |