Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 18:45 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. =============================================================================================================== #netlogo #python This method creates the commuters for the model. They spawn at the rate given in the gui and give them a route to compelte. Last edited by rabbott at
18:46 Apr 03, 2020.
|
tkitcha
Posts: 19
|
Posted 15:21 Apr 05, 2020 |
My understanding of this function in English: Generate a single agent at a certain time and then reset the time back to 0, otherwise increment the time. The agent will be assigned to one of the three routes and appropriate direction. |
rabbott
Posts: 1649
|
Posted 16:38 Apr 05, 2020 |
Thanks, Tanya, 1. What does the constant 250 represent? What about
testing for? 2. What is 3. What does the construct 4. The line Last edited by rabbott at
17:03 Apr 05, 2020.
|
sdo8
Posts: 54
|
Posted 23:49 Apr 05, 2020 |
Here's some answers that I have for spawn-commuters that may come in handy for some peopleThe number 250 is somewhat arbitrary, since the comparison Patch -22 22 indicates the top-left patch (or the top left corner node of the traffic grid). You can easily replace "Patch -22 22" with "top-left" and it will still work, since it is a global that is defined in the setup. Sprout-commuters asks the patch to "sprout" (Create) a number of "commuters" (Turtles) on that specific patch. In this case it's 1 commuter. Immediately following "sprout-commuters", is a [ ... ]. The lines between the brackets are commands that the turtles will follow immediately after they are sprouted. Within these commands, the turtle is asked to set it's route to a new-route. We know so far that there are 3 types of routes that turtles can take (Thanks to Ricardo on one of his forum posts)... "0 = top route, 1 = bottom route, and 2 is the route taken with braess road." When we call new-route, we check which of the three route selection modes are currently selected and run the selected analysis given our current world. These routes will "report" (or return) a road to take .. 0, 1, or 2 given whichever algorithm you choose via gui. |
rabbott
Posts: 1649
|
Posted 18:46 Apr 06, 2020 |
Very good explanation! |