![]() If that doesn't point you in the right direction, posting a working but simplified version of your code with the bare minimum that demonstrates the problem would help. My best guess based on what I see is the failure to change one of state or started? or the failure to check waiting? are involved in the code not working as you'd like it to. If you're expecting changing waiting? to 1 or 0 to kick off some behavior, it's not going to happen according to this code. state and started? are never set in this code, they never change. What I can tell is that neither waiting? or started? are being used to make decisions in this code. What I see here is that we have three variables, state, waiting? and started? that all seem to be meant to do similar things it's hard to tell from the context and the code given. ![]() do whatever choosing the station bus is here, based on the number givenĪgain, we've not fixed anything, but still a little clearer for me to try to understand to help. I cannot see that procedure to know how easy that would be, but you can change things like so as a first step: to I would also personally refactor your .* method to take an argument with the bus_lines_stations_buses. That's not going to fix anything, but it's much easier to read. I will try help a bit, but without the full model it's quite difficult.įirst, you can use NetLogo's multi-case ifelse to simplify go.hybrid.buses procedure: to go.hybrid.buses If ticks = ((patterns * nb_ticks_patterns) - 1)Īsk clients Īsk buses with of myself] and even there, the chain is not fonctionning correctly. when the model is running, buses are just waiting until ticks = 500 to start picking up clients and circulating. The code below is not working properly and i couldn't find a way out. The main condition here is that for every bus line, only one bus at a time can be picking-up clients at departure station, and that the bus only leaves if his occupation rate gets over 80% or if he's being picking up clients for at least 500 ticks. The idea is that i have a number of buses working on 15 bus lines that have a departure station on which buses stay inline waiting for their turn to start picking up clients, and then start circulating. Makes no sense in NetLogo: every model will always have at least one patch, so you will never get to the point of having no patches.I'm trying to create a model for a hybrid public transportation network. The way you have it now, set n0 count turtles is outside the command block of the loop and this means that the loop will go on forever, because it will never get to the point where n0 is updated and so n0 < s will always evaluate as true.Īlso, note that saying let c count patches Note that, in your while loop, you need to include set n0 count turtles within the command block (as in while ). I Need Help Where Do I Look This depends on what you need help with. The most recent version of NetLogo can be downloaded here. Other users should visit the NetLogo home page at Northwestern and the NetLogo users group on Google. ![]() Observer> print first (last (first my-list)) NetLogo This page is for open source developers interested in the source code for NetLogo. In general, you can apply this mechanisms to how many levels of nesting you wish.įor example: observer> set my-list ] ]] So there you can do: set reproduction first (first list3) This means that first list3 is equal to last list3 which is equal to item 0 list3, all of them being. Now you should be able to easily solve your problem, because your case is easier than this: your list3, which in your example is ], only has one item in it. However, NetLogo does not really need that: observer> print item 1 first my-list The parentheses there are optional: they are useful to make the statement more readable to humans, reminding us that the whole first my-list is a list from which we are extracting the second item (i.e. written in Python or Java (NetLOGO, MASON, Mesa), show that Agents.jl outperforms all of them in computational speed, list of features and usability. For example, if you want to extract the second item from that list, you will simply do: observer> print item 1 (first my-list) So you can treat first my-list as any other list. This means that now, for NetLogo, the whole first my-list statement is equal to in other words, it is a list containing those numbers. Therefore, we have: observer> print first my-list So here we just created a list whose items are other lists. Just create a global variable in the Code tab, as globals, and then follow my statements in the Command Center: observer> set my-list ] You can easily understand how to do this by playing in the Command Center and seeing how NetLogo responds to your calls to the list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |