netlogo 编程问题 - Catalyst 实现第 2 部分

发布于 2024-08-24 08:31:43 字数 509 浏览 6 评论 0原文

催化剂加速反应,但反应发生后保持不变

我尝试了以下代码

品种[催化剂催化剂]

品种[化学-x化学-x]

;然后由于催化剂的存在而加速了正向反应

-向前

让 num-catalysts 计数催化剂;通过 num-catalysts 加速

;...

结束

,它工作正常,但我想这样做,以便可以使用“开关”按钮打开和关闭催化剂..这样就可以看看有和没有催化剂的效果..我尝试放入一个开关,但催化剂已经被定义了

我也想让催化剂可见,这样人们就可以在实际的实现中(在世界上)看到它,就像把它变成一只乌龟 除了使用品种之外,还有另一种方法可以实现这一点吗?

我尝试将催化剂制成乌龟,但不起作用

;使催化剂在实施中可见

清除所有

crt催化剂100

询问催化剂[设置颜色白色]

显示其中一种催化剂的[品种];印刷催化剂

任何帮助将不胜感激 谢谢

the catalyst speeds up the reaction but remains unchanged after the reaction has taken place

i tried the following code

breed [catalysts catalyst]

breed [chemical-x chemical-x]

;then the forward reaction is sped up by the existence of catalysts

to react-forward

let num-catalysts count catalysts ;speed up by num-catalysts

;...

end

and it works fine but I want to make it so that the catalyst can be switched on and off with the 'switch' button ..so one can see the effects with and without the catalyst..i tried putting a switch in but catalyst has already been defined

Also i want to make the catalyst visible so one can see it in the actual implementation (in the world) like making it a turtle
is there are another way to implement this apart from using breeds

i tried making the catalyst a turtle but it doesnt work

; Make catalyst visible in implementation

clear-all

crt catalysts 100

ask catalysts [ set color white ]

show [breed] of one-of catalysts ; prints catalysts

any help will be greatly appreciated
thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花伊自在美 2024-08-31 08:31:43

回复:“我尝试放入一个开关,但催化剂已被定义”,您需要为开关指定除“催化剂”之外的不同名称。同一个名字不能用来表示两种不同的事物,并且“催化剂”已经被用作该品种的单数形式。

海龟默认情况下总是可见的,除非你做了一些事情来隐藏它们,所以我不明白你的问题中与“如何使催化剂可见”有关的部分。它们是可见的。如果您执行“crt 催化剂 100”,则所有催化剂都位于同一位置,因此看起来可能不像有 100 个。尝试将它们传播到世界各地。

re: "i tried putting a switch in but catalyst has already been defined", you'll need to give the switch a different name besides "catalyst". the same name can't be used to mean two different things, and "catalyst" is already in use as the singular form of the breed.

turtles are always visible by default unless you do something to hide them, so I'm not understand the part of your question that has to do with "how to make the catalyst visible". they are visible. if you do "crt catalysts 100" all the catalysts are on the same spot, so it might not look like there are 100 of them. try spreading them around the world.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文