Help with initialize turtles from the same home patch for each scenario

22 views
Skip to first unread message

vidus...@gmail.com

unread,
Sep 30, 2021, 4:21:06 AM9/30/21
to netlogo-users
Hi All 

I have been struglling on this for quite a while now, I would be grateful if anyone can please provide some help. 

I am running my model to see how the change in landscape scenario 'baseline' and 'future' affects agents' annual travel distance.  I have initialized agents on a random patch within their residential postcode boundary. 
To be able to compare change in travel, I should have them initialized from the same patch for both the scenario. I have been trying using random-seed but can't get it to work. I want to run the model for 100 different initial patch for each baseline and future scenario. 
When I use random-seed in setup, it inititalize agets from different patches for each scenario. 
I tried setting a global variable random-seed-turtles  and tried 2 runs in behaviour space with two different seeds 
[ "random-seed-turtles"  1 2 ]   
[  "landscape-scenario"   "baseline" "future"] 

It creates turtles from the same patch for each run for baseline but differs in future. 

Is there a way to code so that I can have different initial patch for turtles for each of the 100 runs but same origin for individual run. 
e.g. 
run1 
baseline my_home  = patch 113 224
future  my_home  = patch 113 224

Please help me with this issue.

Kind Regards

Vidushi


Pradeesh Kumar K V

unread,
Oct 1, 2021, 8:39:54 AM10/1/21
to vidus...@gmail.com, netlogo-users
Hello Vidushi,

The detail you have provided namely 

"random-seed-turtles"  1 2 ]   
[  "landscape-scenario"   "baseline" "future"] 

indicates combinations :               random-seed 1, landscape "baseline"; 
                                                      random-seed 1, landscape "future"; 
                                                      random-seed 2, landscape "baseline" & 
                                                      random-seed 2, landscape "future"

If your code is such that baseline and future scenarios get executed during every run (as indicated by your example), then you don't need landscape in behavior space.

Also, if your code contains baseline and future scenarios to be executed during a single run, then definitely the initial patches will be different as random-number generator has already been invoked by the baseline code before it is called again by future scenario code. Therefore, if you need to have the same patch for future scenario also, then you will have to reset the random-seed again before start of the future scenario code. But I don't think that is a good idea.

In such case, it is better to split the model into two sections such that only one section is executed during any run. Then define landscape scenarios "baseline" and "future" for each section, respectively. So if baseline is selected, only the baseline codes will be run and vice versa. Ensure that random-seed setting is common for both the sections.

Hope this helps,

Best,

Pradeesh

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/a8e61771-ea86-4504-8f97-4476e2c1684en%40googlegroups.com.

vidus...@gmail.com

unread,
Oct 2, 2021, 1:15:09 AM10/2/21
to netlogo-users
Thank you Pradeesh. 

In my code "landscape_scenario" is a chooser on the interface and one run only includes eithr 'baseline' or 'future'  scenario. I was thinking to add random-seed -turtles  as a slider with maximum value of 100. 
In this case, should I just use one repetation so that I get 200 outputs based on the combination that you mentioned? 
 e.g. : 
random-seed 1, landscape "baseline"; 
random-seed 1, landscape "future"; 
random-seed 2, landscape "baseline" & 
random-seed 2, landscape "future"
...........

Kind Regards
Vidushi
Reply all
Reply to author
Forward
0 new messages