在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus& c/ K5 X; p, y" h, Q+ n
ask turtles with [infected?]# S. J. q/ f+ U' A$ b4 F
[ ask link-neighbors with [not resistant?]0 u; E+ x/ i" y- e, q0 S
[ if random-float 100 < virus-spread-chance, ^0 ^9 s8 W! Y' Y$ Y& S( f) D
[ become-infected ] ] ]
6 d$ m4 a% L8 xend1 l$ T' P" J6 k, j5 x
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
6 _: j0 R( ?$ K* h& qto do-virus-checks
9 }) O( z. [9 r) s, {, ~1 G ask turtles with [infected? and virus-check-timer = 0]0 I: w. |! _7 N
[! L; N5 m. Z( r6 u% C. a2 R2 c
if random 100 < recovery-chance
1 T6 O$ Z# `" ~4 ?* N& N) ] [+ x1 L6 ~9 n7 b
ifelse random 100 < gain-resistance-chance. F+ w& h1 {" s' M% V) [
[ become-resistant ]" v f& u: F0 ?# W
[ become-susceptible ]
5 c3 w0 P" W/ T ]. R/ c1 D* z8 j4 X" T- m( w N$ H
]: N# L' n1 V1 q' y
end% h, h6 F, C$ s, A0 Z
下面同样这个问题不明白8 s. w+ b) y3 i" o# O
小妹求大神帮忙!!
( x' B. t- z3 H6 m5 s, _8 p- P- s |