对其他海龟执行没有影响但加快反应速度的海龟
我正在使用 netlogo 中名为化学平衡的现有模型,并添加更多代码。我想添加海龟(催化剂),它对反应/其他海龟没有影响,但会加速前向反应,其定义如下:
to react-forward [t]
ask t [ set color red ]
set color green
rt random-float 360
jump 2
end
我在想我应该放一个开关和滑块,使海龟变成whitemols或者我做一个海龟自己的[催化剂]
,然后像我对温度和压力所做的那样定义它。我尝试了以下方法,但没有成功。
turtles-own [speed catalyst]
crt whitemols
[ set color white
randomize
set speed 1
]
我知道上面的代码不正确,但不确定如何编写此特定功能的代码。
I am using an existing model in netlogo called Chemical Equilibrium and am adding some more code. I want to add turtles (catalyst) which have no effect on the reaction/other turtles but speeds up the FORWARD reaction, which has been defined as follows:
to react-forward [t]
ask t [ set color red ]
set color green
rt random-float 360
jump 2
end
I was thinking that I should put a switch and a slider, make the turtles into whitemols or I do a turtles-own [catalyst]
and then define that like I have done with temperature and pressure. I tried the following but it didnt work.
turtles-own [speed catalyst]
crt whitemols
[ set color white
randomize
set speed 1
]
I know the above code is incorrect but am not sure how to code this particular feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,有很多方法可以做到这一点。我无法从您包含的小片段中看出您的程序中发生了什么。
一种方法是使用不同品种的催化剂:
There are many ways to do this, of course. I can't tell what is going on in your program from the little snipped you include.
One way would be to have the catalyst be of a different breed: