breed [S a-S] ;定义易感者
breed [I a-I] ;定义感染者
;breed [R a-R] ;定义免疫者
to setup
clear-all
create-S 1000
[
setxy random-xcor random-ycor
set color green
set shape "circle"
set size 0.75
]
create-I 1
[
setxy random-xcor random-ycor
set color red
set shape "circle"
set size 0.75
]
reset-ticks
end
to go
ask S [move]
ask I [move]
tick
end
to move
ask turtles
[
lt 40 - random 80
fd 1
]
end