English 中文(简体)
netlogo programming question - catalyst implementation part 2
原标题:

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

问题回答

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.





相关问题
What are the differences between NP, NP-Complete and NP-Hard?

What are the differences between NP, NP-Complete and NP-Hard? I am aware of many resources all over the web. I d like to read your explanations, and the reason is they might be different from what s ...

Implementation Detail for Graph Analysis Algorithms

Let s say I have a graph with "heavy" nodes, that is each node is an object that is already carrying a lot of data. I want to do a graph transformation that requires me to calculate a special ...

Worst case running time (Big O)

I have this question, and I don t know how to solve it, because I don t understand it. :( The question is: Programs A and B are analyzed and are found to have worst case running times no ...

RSA cryptosystem

Hi i am trying to set up an RSA cryptosystem i have all the values except d selected prime numbers: p=1889, q=2003, n=3783667, phi=3779776, e= 61 i got stuck finding d could anyone help me to figure ...

BNF Grammar Derivation

I want to apply rules of BNF Grammar to produce derivation for : a_Num

热门标签