在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
\" i; b6 e Q$ P/ u ask turtles with [infected?]. G3 e, r" |9 ]
[ ask link-neighbors with [not resistant?]
1 p1 k2 E3 E0 V9 B3 c \2 @/ {7 u [ if random-float 100 < virus-spread-chance8 H8 U( s7 C- n" i
[ become-infected ] ] ]. v7 e# J7 O/ r$ X3 e5 p) R. Y+ W
end
8 W4 V+ y$ o5 [0 M6 ~这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
9 r% `$ `0 R3 Z" J, Fto do-virus-checks
+ k9 h! @) g" P9 j" Y5 f) N0 E8 W ask turtles with [infected? and virus-check-timer = 0]' N& q C s( B3 a3 M. ^
[% X" K# i: h6 Z4 k
if random 100 < recovery-chance
* I. n" i) y9 f [& _* t1 Z) V% O3 T
ifelse random 100 < gain-resistance-chance
2 C# s s8 ~: G, D [ become-resistant ] r" o4 @ M3 B0 f
[ become-susceptible ]" w* x$ c* C) x* b5 W5 W& v
]7 {( ?/ _! i5 k% r5 e
]
" \( I1 F7 X) Y. U! b( i8 f5 oend; {* |/ l! k# W- z. R/ T
下面同样这个问题不明白
+ O) a' |& _, y( _) G) o6 d, f小妹求大神帮忙!! K' ~4 i" o0 R! v3 t$ `1 G v
|