在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus
9 y) I( Z- j; K" n" j ask turtles with [infected?]
' S+ o* V1 Z5 d7 D" @$ d/ Y+ V6 U' [ [ ask link-neighbors with [not resistant?]1 W0 _ {' U) R
[ if random-float 100 < virus-spread-chance
: C1 {$ \* J8 E$ @! r7 i [ become-infected ] ] ]
5 J/ H' \( z: Q$ w% Q3 mend
0 w+ s3 _$ W3 _4 j0 w这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?+ p _" y' U! C3 h c, s) ~
to do-virus-checks# f* k0 e L3 v7 D4 ?, M* Y% a
ask turtles with [infected? and virus-check-timer = 0]
) C# @0 e' z5 ]4 _( \2 C2 U [& j# {. F1 M+ l3 m
if random 100 < recovery-chance2 p* d. ?6 M; \+ k$ H( Y/ D0 {
[& }. w7 X8 O* |* ^ u
ifelse random 100 < gain-resistance-chance
' n4 a) l8 F+ V+ A7 s [ become-resistant ]
" g( j/ x5 ~& J( m V8 ~6 ^ [ become-susceptible ]6 I" o7 g! K3 Y" p! u7 ~! ?& l1 s
]) O; ]9 I/ n7 S5 p, f
]
/ W' C8 h5 |6 T; |8 y4 s8 `end
, O8 T* N* ?* @下面同样这个问题不明白
2 l1 m% S. _$ v7 J. u0 F3 p小妹求大神帮忙!! 5 J) |' X! Y9 C* V
|