在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus+ ?$ I" d9 D4 t- W$ M) k) L: H
ask turtles with [infected?]
7 t4 i3 h7 d" |+ I. K [ ask link-neighbors with [not resistant?]
& c5 W: s- K, m" h* t5 J [ if random-float 100 < virus-spread-chance( T( i8 E' @2 ^* t0 l2 ~
[ become-infected ] ] ]/ L1 k$ X0 y p, o
end o1 F* Y- ]4 ]/ p/ R0 h3 `
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
0 G5 r4 F: N2 \" E# W- D# B" y, P2 ]/ Dto do-virus-checks
2 q w3 u. A3 H1 E ask turtles with [infected? and virus-check-timer = 0]/ D5 s" k$ b7 X- U9 C6 ]
[
' l3 }+ H( t! _ if random 100 < recovery-chance) ]) n; A+ _7 D1 s/ m5 K. C# e
[- N+ D5 I( k: b5 @8 k2 D
ifelse random 100 < gain-resistance-chance
2 Q' w) F( d0 J$ @ [ become-resistant ]
* U4 i1 O5 s# R [ become-susceptible ]
1 q) T+ j2 b- o4 e6 s: f ]$ y, G% T& Z6 O) r" Z
]+ z7 l1 S* U e# g# e' g
end. u( b3 K# Q2 Y
下面同样这个问题不明白$ R1 B9 d- B) V; o' u
小妹求大神帮忙!!
H9 V# ?3 [9 } B' | |