I am trying to create a model in which a question is posed to turtles. Each turtle represents a unique domain of knowledge (1, 2, 3, 4, 5...) and each question contains a random subset of domains, e.g., (3 5 8).
I then want to ask turtles with IDs that are contained in the question to answer it. I am hoping to get some advice on:
- how to create the random array for the question (global variable) and;
- how to compare that against the turtle IDs.
This is my first time using NetLogo, so I apologise for the ignorance. And I'm definitely not asking you to write the proc for me but what I could use some advice on the right direction / commands to try.
For 2. the comparison, I have written the following but I'm unsure if this will work. My concern is if it is looking for an exact match of the question array with the turtle ID, a match will never be found. What I intend is, if a turtle ID is ANYWHERE in array, THEN [set expert? 2]:
to give-an-answer
foreach question [
if question = who [set expert? 2]
]
end
Very much appreciate any advice you can give me!
Thanks John