在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
7 p6 A; Z! B# `8 ?6 e/ d/ h O ask turtles with [infected?]
. D& a. m! h& F+ ]4 \# P1 Z4 c [ ask link-neighbors with [not resistant?]0 T! e7 g- S5 h
[ if random-float 100 < virus-spread-chance
: A% ]; R* Z; F( x' n [ become-infected ] ] ]
" d0 T' D* ~) ]4 t/ @end, C f0 v2 z6 z e
这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
! L& C& c1 p& x6 T) k( uto do-virus-checks
" M' a; @5 V9 d$ W% g) f1 b ask turtles with [infected? and virus-check-timer = 0]8 h j4 [$ k# F! I6 M$ s6 b
[
& K6 I9 X" ]4 f9 l5 w' {+ z; J if random 100 < recovery-chance9 x& z6 T3 W+ {4 y. j
[
% d* _0 H ]! J/ f! \" \ ifelse random 100 < gain-resistance-chance$ i/ F9 ?/ c. s; q5 J
[ become-resistant ]
2 k1 W5 l( C* D! k0 F [ become-susceptible ]/ S* e0 b. l. E3 \5 A) e
]
5 e% s m, L: m8 c ]
1 j5 T, r; ? D9 qend
% X2 W# n$ ~0 u7 h5 B下面同样这个问题不明白, _$ a7 A5 B0 u2 H# v/ I# w2 `
小妹求大神帮忙!!
7 T1 V4 ~, i8 a+ j n1 x |