【发布时间】:2018-12-24 23:24:41
【问题描述】:
在我的程序中,每只海龟(即葡萄糖和细菌)都有自己的变量,称为质量。设置程序表明葡萄糖和细菌的初始质量为 1 mmol。 to-go程序说葡萄糖将被水解和分裂。因此,葡萄糖质量将不同于最初的 1 毫摩尔。细菌的待处理程序说,当细菌吃一个葡萄糖时,细菌的质量将从最初的 1 mmol 加上它消耗的葡萄糖质量(在分解水解葡萄糖程序中确定的随机数)增长一次固定数字(即 0.3)。如何限制细菌每次滴答时可以消耗的葡萄糖质量(最大摄取率)? (1 滴答= 1 小时)我如何设置猎物剩余的葡萄糖质量?例如,如果细菌只能吃(摄取)0.0207 mmol葡萄糖/h,但水解后的葡萄糖质量为0.6 mmol;那么,细菌只能使用 0.0207 的葡萄糖质量。剩余的葡萄糖质量必须重新计算为 (0.6 – 0.0207)。我使用原始的“我自己”来指代“外部”上下文中的代理——在这种情况下,“外部”代理是细菌。但是,错误提示“我自己没有可参考的代理”。
对这个问题有什么建议或建议吗?
Breed [glucose a-glucose];; Food-prey
Breed [bacteria bacterium] ;; Predator
glucose-own [glucose_mass]
Bacteria-own [bacteria_mass uptake]
设置
;;;葡萄糖;;;
Create-glucose (8) ;; Create the glucose available in mmol/d,
[set glucose_mass (1)] ;; in mmol
;;;细菌;;;
Create-Bacteria (10) ;; Create the clostridiales in mmol
[set batceria_mass (1)
Set uptake (0.0207)
]
end
去
ask glucose
[
Hydrolyse_glucose
Divide_hydrolyzed_glucose
]
ask Bacteria
[Bacteria_eat_glucose]
to hydrolyse_glucose
if (glucose_mass < 200) [
set glucose_mass ((glucose_mass * 0.025 + random-float 32.975) / 24)
]
end
to divide_hydrolyzed_glucose
if (glucose_mass > 1)
[
set glucose_mass (glucose_mass / 2)
hatch 1
]
end
to Bacteria_eat_glucose
let prey one-of glucose-here
if prey != nobody
[
ifelse [glucose_mass] of prey > [ uptake ] of myself
[
set bacteria_mass bacteria_mass + [[ uptake] of myself * 0.3]
ask prey [set glucose_mass glucose_mass – [uptake] of myself]
]
[
set bacteria_mass bacteria_mass + [glucose_mass * 0.3] of prey
ask prey [die]
]
]
end
【问题讨论】: