Question

My question was, is there anyway through Netlogo to be able to include the Setup Procedure WITHIN the go procedure so that each iteration or TICK within the go procedure has a slightly different setup because of agent-evolution?

In my case in particular, i am modeling a flight leg where I have three airlines competing to find the best schedule for the flight during the day based on a utility model, and then a number of passengers that choose which flight is more appropriate for them with another utility model. My aim was to be able to vary the demand of passengers in each iteration through the go procedure even though this is dependant of the setup procedure and have the airline continuously vary their fees in order to attract more passengers and I feel I cannot do this because the Setup procedure limits me into only being to create one possible situation and doesnt allow for the evolution of my agents.

Thank you for your help, I really appreciate it.

Was it helpful?

Solution

The use of procedures named setup and go in NetLogo, and the pattern in which you typically attach them to buttons, is purely a convention. You can make as many procedures as you want, call them whatever you want, and have those procedures call each other in any way you want.

So for example, if you want to call setup from within your go procedure, go right ahead.

If your setup procedure calls clear-all, though, that might not be a smart thing to do. In that case you'd want to split the setup procedure into two separate procedures, where one of the procedures contains only the part you want to reuse. Something like:

to setup
  clear-all
  ...
  setup-environment
  ...
end

to setup-environment
  ...
end

to go
  ...
  setup-environment
  ...
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top