在netlogo模型库中有一个virus on a network,里面有一个代码to spread-virus1 P* q2 ~9 F* N' b0 y* Y( \) T
ask turtles with [infected?]3 B+ C) f" D% z" C9 v' C
[ ask link-neighbors with [not resistant?]* J b5 ] V0 H9 T" L
[ if random-float 100 < virus-spread-chance
1 i P* h, e4 |4 l0 T9 @ [ become-infected ] ] ]/ Y, m4 v7 x7 l3 n( R
end
5 |) l2 M3 ]0 D: E# ~9 y% o4 m这里为什么virus-spread-chance大于random-float 100,就可以判断出become-infected呢?
9 K/ X& n, u/ ?% Y/ |$ i2 Sto do-virus-checks
# ?* n! p$ X+ W2 e' ~6 d ask turtles with [infected? and virus-check-timer = 0]
7 C2 z, A/ n, z, B' Z5 ~ [
* Z) v( y$ F0 c9 z if random 100 < recovery-chance
4 I9 q- O0 L. Y) R9 M [( u8 Q# b$ s* J4 b
ifelse random 100 < gain-resistance-chance4 ~0 b. ?; g3 O* j
[ become-resistant ]- L; G9 |9 p2 I% L& V
[ become-susceptible ]
4 p0 c# G7 S1 q7 H# Z ]
. D" m5 n, O9 T3 b* |. z: i4 t ]) M2 S( @4 s8 R4 f
end
- L- a) E- ^3 O1 C) h* I下面同样这个问题不明白! d& |/ j. \5 [4 L, u3 y" u
小妹求大神帮忙!!
/ |' S1 W; Q6 A) ]; N4 h3 l6 g |