在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus- T% u# q/ X! \7 l; e2 a8 q! i
ask turtles with [infected?]
\2 _- f9 o W8 f! @* H0 r" u1 ^ [ ask link-neighbors with [not resistant?]
5 H( v% f9 l, @ [ if random-float 100 < virus-spread-chance+ U, D D7 @3 k: L" ?5 q$ g
[ become-infected ] ] ]1 o( M g1 n7 a, ^
end6 n1 Y9 N* X: ?- W
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?0 d8 I% K- F R9 V6 B: _ G9 l
to do-virus-checks, W; @& W8 n. [7 J- t
ask turtles with [infected? and virus-check-timer = 0]
8 |! \: Z, X6 _ [) }+ \8 ?, ^2 _. l; I
if random 100 < recovery-chance' F( `0 ~4 m$ l1 E% X) `. p
[% e4 `) h1 G6 ~& L# D8 z9 \
ifelse random 100 < gain-resistance-chance( l3 a1 H4 o0 J9 Y2 z. x5 n
[ become-resistant ]
& A" M" w# i$ j [ become-susceptible ] s$ g" t2 M) R: k5 Q
]# d* F- P) K$ ~" ~- g# A0 I7 O) n
]% v# t& K$ i& F+ U" V* v; K
end
4 M# r: X# L5 j7 s$ ~. S8 S下面同样这个问题不明白3 j8 o' f$ L& f. g* {( W3 y7 e
小妹求大神帮忙!!
8 F. H' b! o _. ]8 | |