在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
5 u* V/ [. Z# W3 H( S2 d& F5 F ask turtles with [infected?]) m' x# u% {+ F5 f6 k
[ ask link-neighbors with [not resistant?]$ p3 Q7 q3 x( M8 W$ J& B% w
[ if random-float 100 < virus-spread-chance# f; E7 w# J% I# w7 F1 ]9 m% b
[ become-infected ] ] ]. O% q$ f2 D- t* E
end, Q2 Z+ f) }- R$ p8 Z
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
+ r* m4 o+ f3 `0 i* E& Gto do-virus-checks
' h: s7 p2 }" z/ l& K) A ask turtles with [infected? and virus-check-timer = 0]
4 A# Q7 ? o/ P [
; F2 V% K: C) f3 r- W if random 100 < recovery-chance7 q. v5 U, ]& _& Y" k
[& |! ]- B# P- z% h' N+ `
ifelse random 100 < gain-resistance-chance
" N6 k0 U6 o( {1 p. s8 }0 j8 Y, k [ become-resistant ]4 _# ]6 G# H' z* {' L* c
[ become-susceptible ], u% S( S8 H7 Q/ W i3 U
]
2 {1 R; A4 i. f+ z9 Q$ p/ r ]
* Q* [& I# h7 _/ z4 K+ x$ [end% L' c5 Q% L1 j' H
下面同样这个问题不明白3 b* d' f& x. O( B7 l; e
小妹求大神帮忙!! 5 {& m K# {: @) L% Y
|