In my model the behaviour of turtles is defined by a combination of different procedures, depending of setup parameters. Let's say I have a code:
to go
ask turtles [
if (parameter1 = "A") [behaviour-1A]
if (parameter1 = "B") [behaviour-1B]
if (parameter2 = "a") [behaviour-2a]
if (parameter2 = "b") [behaviour-2b]
...
]
end
(Actually, I have now 3 such parameters each with 2 or 3 possible values, but I have to add more as I develop my model) This works, but is is very clumsy. Both parameters are constant, set up at the beginning of the simulation, and the situation when each turtle at each time-step have to ask about the value of these parameters is very ineffective. Is it possible to ask it only once at the beginning of the simulation? Something like:
if (parameter1 = "A") [set behaviour1 behaviour-1A]
if (parameter1 = "B") [set behaviour1 behaviour-1B]
if (parameter2 = "a") [set behaviour2 behaviour-2a]
if (parameter2 = "b") [set behaviour2 behaviour-2b]
...
to go
ask turtles [
behaviour1
behaviour2
]
end