pyNetLogo vs NetLogo
This is more of a question than an issue. I'm running a model and I've incorporated a random-seed at setup so that my results can be repeated easily. Within pyNetLogo I get the same results. And within NetLogo, I get the same results. But the outputs from NetLogo and pyNetLogo are different (i.e. running the model from NetLogo directly will give different results than if I run it from pyNetLogo). Can you think of a reason why this might be happening?
can you share some code snippets?
Sure:
This is how I have the setup in NetLogo
And this is how I'm running it from Python
I'm setting up all of the parameters in the for loop, then I set the random seed (I added this later but it makes no difference if the random-seed is in the setup or in python, it's still the same result), I do the setup procedure, and set the max ticks. In the while loop, I'm running the code for 10 ticks at a time and checking if it has reached steady state. If it has, I'll set the max ticks to the current time + 100 ticks. And I'll repeat the go command 110 times to make sure it finishes running properly.
The only minor thing I notice is that you set the random seed from python before calling setup, while the NetLogo setup starts with a clear-all. I am not a NetLogo expert, so I don't know what clear-all exactly does, but that might be a possible explanation. How is the setup in the model different between running directly through NetLogo, and when running via pyNetLogo?
If you want to investigate this properly, I would isolate the problem by having the simplest possible model where, for several ticks, a single agent retrieves a single random number and sets this on a reporter.