在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus7 r/ F5 A% }0 P+ m! X1 @
ask turtles with [infected?]
2 s. x# q/ k9 y! E [ ask link-neighbors with [not resistant?]
" Q: l* k0 O) G. H- Z. u) @ [ if random-float 100 < virus-spread-chance, U, X! E( i4 B) }
[ become-infected ] ] ]: d& F9 h% o4 C
end
2 W$ u! S6 ?1 e6 [这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
2 i, L+ ?4 S3 F- O. T2 a* Pto do-virus-checks
0 \7 w# c0 E) W4 K) h: [4 B+ @% @ ask turtles with [infected? and virus-check-timer = 0] T' j) Y* x* _( a7 u' }" H
[
4 Z- c n: g) ] m if random 100 < recovery-chance) d8 g' `8 x- a. h+ e3 q, P# H+ ^
[
( C d% ^( I [% G" i ifelse random 100 < gain-resistance-chance
% b' T+ C0 \ Q' i; L" a" X3 I [ become-resistant ]
4 I1 n& U" y4 c- \ [ become-susceptible ]
. D0 ~* ~- d1 Y0 p ]' a2 W2 C: ~1 M; A( Z
]! U& Q f4 n! M8 w
end. S3 H1 L# c* G [4 V# X1 _; R
下面同样这个问题不明白2 W$ }- X* [* u1 C
小妹求大神帮忙!!
6 W. M1 D3 D I% B5 i |