我试图模拟一个简单生物的分化模式。这就是我喜欢我的品种和变量的方法:
品种:营养体和异种细胞。植物可以分裂,异形体可以分开。植物可以成为异形细胞。理想情况下,一旦形成异形囊,植物就越接近它,它就越不可能成为异形囊。
变量:
年龄:每蜱+ 1, - 新孵出的龟为1
bump:一种用来取代位于前方的所有海龟的方法。一只新孵出的乌龟,所以它们不会重叠。我想象系统有点像牛顿的摇篮(http://s.hswstatic.com/gif/newtons-cradle-1.jpg)
亲:促进者。累积随机累积。一旦达到一定值('浓度'),植物人就会改变品种成为杂环。价值下降了inh。proL:pro的标签,带有舍入值。
inh:抑制剂。理想情况下,这个值应该形成一个渐变' (异卵囊附近海龟最高,距离最远)。我能看到的一个明显问题是我得到了许多连续的异形囊。这是我一直试图避免的。但我无法看出出了什么问题......请帮帮忙?
to setup
clear-all
setup-turtles
reset-ticks
ask turtles [ set size 1 ]
end
to setup-turtles
create-vegetatives 1
ask turtles [
setxy random-xcor random-ycor
set shape "circle"
set color 65]
end
to go
divide
add-age
move
differentiate
tick
end
turtles-own [age
bump
inh
pro
proL]
breed [vegetatives vegetative]
breed [heterocysts heterocyst]
to add-age
ask turtles [
set age age + 1
ifelse show-age?
[ set label age ]
[ set label "" ]
]
end
to divide
ask vegetatives [
if random 100 < 2 [
hatch 1[
set bump 1
set age age - 1
set inh 0
]
]]
end
;;Trying to get only one turtle per patch, making the others move
to move
ask turtles[
while [bump = 1] [
ifelse not any? turtles-on patch-right-and-ahead 180 1[
rt 180
fd 1
set bump 0
if any? other turtles-here[
ask other turtles-here
[set bump 1]
]
]
[fd 1
set bump 0
if any? other turtles-here[
ask other turtles-here[
set bump 1]
]
]
]]
end
to differentiate
ask turtles[
set pro (pro - inh + (random 2))
set proL round pro
ifelse show-proL?
[ set label proL ]
[ set label "" ]
create-links-with other turtles-on patch-ahead 1
create-links-with other turtles-on patch-right-and-ahead 180 1
if breed = vegetatives [
if any? link-neighbors[
ifelse any? link-neighbors with [breed = heterocysts]
[]
[set inh mean [inh] of link-neighbors]
]
if any? vegetatives with [pro > 50]
[ask vegetatives with [pro > 50]
[set breed heterocysts
set color brown
set shape "circle"
if any? link-neighbors[
ask link-neighbors with [breed != heterocysts]
[set inh 2]]
]]
]]
clear-links
end