在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
4 n- U \3 X: L! @; W) \ ask turtles with [infected?]
! w6 W P4 `, e; f [ ask link-neighbors with [not resistant?]: w( }8 b7 {0 V- N" o1 h7 c, D4 f' k q
[ if random-float 100 < virus-spread-chance' E; H$ j) N% g; _
[ become-infected ] ] ]
. z$ b' @8 a" ]& H- J; z6 B1 ~end
! @$ X! ^% m/ W; M/ q- X6 k' G这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?' P" b# j& R g. H" P/ t$ J
to do-virus-checks
* V+ x2 T |0 t b0 _( r ask turtles with [infected? and virus-check-timer = 0]; Z& g; ]0 o4 N2 t, Z5 l
[0 |" v) y3 i [" ?( Z2 X$ V$ t
if random 100 < recovery-chance8 g) S- e, m! J' B) Y% Z. h! m. V
[
: M: D8 V4 h) E3 C; ` ifelse random 100 < gain-resistance-chance
9 z* {6 u; q% [% F6 k! X( X: S9 a [ become-resistant ]; ?) U x f/ \7 c6 Y
[ become-susceptible ]
. o ?( B4 U4 Y& D+ \: a# {+ M ]
# p+ ]- o3 r: C1 s& {) a ]1 V( B1 O |4 E( p
end
, J! J6 h" H7 ~下面同样这个问题不明白
) e+ w3 F |$ T g& ^8 m# p( R7 S( {2 ]小妹求大神帮忙!! 0 t2 g- r* a# H! d
|