在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
! @: ^' I/ V4 e: K. B3 _ ask turtles with [infected?]
4 r# `* P* [* Y7 z [ ask link-neighbors with [not resistant?]: n$ Q, {' I% s: L
[ if random-float 100 < virus-spread-chance! a+ k6 y9 y( m2 C7 {* o: O4 o
[ become-infected ] ] ]
: U# e F, e2 e5 d6 Aend- J, ^/ l2 b5 X- ~: g- D
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?5 e! m5 ~6 U! o
to do-virus-checks _+ J' Z8 e1 e1 ?( h
ask turtles with [infected? and virus-check-timer = 0]
0 n5 Q5 H; _) v* y& J# t4 G3 v9 G( H [
% h" i0 ~8 ^# X% K" b if random 100 < recovery-chance9 _0 X% U% V6 V w6 l( z1 Z/ \
[ n9 Q) a; `$ i6 k; M
ifelse random 100 < gain-resistance-chance2 L0 J" }9 O6 s s+ v. P% ~
[ become-resistant ]/ f9 K% h. {9 {3 d* w7 _
[ become-susceptible ]* D% |4 B# Q% \. n1 d
]( v" H. ~; U/ f- b* _; Q; a
]5 N7 h: N4 W4 h& [ A- ]
end
) T( x! e& W+ V下面同样这个问题不明白
7 T$ T; K4 L, R8 k小妹求大神帮忙!!
5 w0 b- U! i1 m5 Q |