Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 18:41 Apr 03, 2020 |
I'm splitting Ricardo's three NetLogo procedures into three posts so that (a) they are not so forbidding and (b) we can comment on them separately. =============================================================================================================== #runs on a single agent #python equivalent #check to see if the agent is at any corner patch and turn directions appropriately, or end commute The things here to consider are the assumptions take, in this case we assume that commuter has a patch and route attribute, as well as a face method and end_commute method. Last edited by rabbott at
18:48 Apr 03, 2020.
|
tkitcha
Posts: 19
|
Posted 15:04 Apr 05, 2020 |
My understanding of this function in English: Move an agent forward to the next patch after it spent enough time on the current patch on a road(a road consists of patches). If the agent is at a corner of the road, turn to an appropriate direction. If the agent is at the finished destination, execute end-commute procedure of this agent. |
rabbott
Posts: 1649
|
Posted 16:20 Apr 05, 2020 |
Thanks, Tanya, Here are a couple of questions. 1. What is 2. What is |
tkitcha
Posts: 19
|
Posted 18:24 Apr 05, 2020 |
1. I also agreed that delay is a Patch instance variable. This variable is used in commuter-move function to compare its value with the agent's variable called tick-here(the agent has to be on the patch) to determine whether or not the agent is allowed to advance to the next patch. 2. last-here is also a Patch instance variable. Although each and every patch has it, only patches that defined as dynamic patches will utilize this variable in determine-congestion function(it appears to be the only place where last-here variable is used). |
rabbott
Posts: 1649
|
Posted 20:06 Apr 05, 2020 |
Thanks, Tanya, One way to find out where a variable is used is to go the actual NetLog code and search for that variable. The other use of last-here is in the procedure In that case, as Tanya said, its value is used to set the delay for the patch. Look at line 138 in the NetLogo code. (You can turn on line-numbers under Tools > Preferences.) The line in question is:
Can anyone explain this expression?
|
sdo8
Posts: 54
|
Posted 00:39 Apr 06, 2020 |
I think I can. Please correct me if I am wrong.
You are essentially setting the delay for a patch (or how many ticks a turtle has to stay on that patch before it can move), but it varies depending on the spawn rate and (ticks-last-here +1). The second part of the computation, or the divisor, The final part of the computation involves multiplying the division by the Once we have the final result, we
Last edited by sdo8 at
00:39 Apr 06, 2020.
|
rabbott
Posts: 1649
|
Posted 18:50 Apr 06, 2020 |
Thanks Stanley. |