在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
! ^. {# G% Q; i4 a ask turtles with [infected?]$ \* M+ z9 a3 K$ y. p
[ ask link-neighbors with [not resistant?]4 j0 f3 \9 z+ J( Y( `
[ if random-float 100 < virus-spread-chance
& e! w$ _ k7 C9 }! q [ become-infected ] ] ]3 t0 B& i+ ]4 L
end2 `. \6 l( f0 v0 Q& e9 w
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?5 Z5 g1 O6 M. h$ \
to do-virus-checks+ |3 ^1 n' g/ T+ g+ X7 T4 n
ask turtles with [infected? and virus-check-timer = 0]! [& k! a" K/ S, o, G9 E6 g1 s1 O
[2 C. J( F0 D7 ]; h- v, L
if random 100 < recovery-chance
+ M& f$ h* y& v/ z [. i8 R1 ^- {2 ~' u/ _ | A/ s
ifelse random 100 < gain-resistance-chance$ p* W \3 R- I/ s; x
[ become-resistant ]
4 p) ?/ A! Q7 x$ s( ]: g1 V [ become-susceptible ]$ T4 x e, `& E
]; f" G8 f: _- v3 s/ @
]
1 {5 p/ O. O% \8 r6 [6 eend; {: q9 X- ?# x( V- H( \
下面同样这个问题不明白 N) X7 N% ^3 D0 w5 H/ N% d
小妹求大神帮忙!!
! L$ i: C7 v: w E+ j9 R |