Moving cars along multiple edges in one time point

I have an empirical network that I loaded. I have nodes that are stationary. I have edges that connect the nodes(say these are roads). Each tick is a day. There is an edge attribute called time. If the edge attribute matches the current time in the program, then those edges are loaded onto the network. I have ~1900 cars that are all loaded but hidden until it is time for them to move. they also have a time attribute and an vehID attribute. The edges also have a vehicle ID attribute so that a specific car travels along only the edges where the vehicle ID attributes match. I have things almost working.
The problem comes in when I have one care that is traveling along multple edges within one day. Right now, my code randomly picks an edge and the car follows that. I need the car to travel along every edge in order in that day.
Here is my move code:

Here is a copy of the edge list:

You can see how the vehicles are traveling back and forth between nodes in the same time period. how can i make it so that the move along all the edges in the same day in order of the edge list? The edge list is loaded into netlogo as a list of lists (each row being the inner list). The vehicles are loaded in the same way. All the nodes are loaded in at the begining.

Thank you for any advice you can give.

I can think of multiple ways.

One simple way is that you have your car to maintain a list of edges that it has travelled by. Then, you can exclude those edges when the car is selecting new edges. This will avoid the back-and-forth problem, because the car tag the travelled road as “unattractive” . If your car is generated correctly in the intializing procudure, and there are no cross-road problem(I think this is a rather simple network?), the car would go along the correct order.

Another way is, you have your car maitaining a road-list, instead of asking the road to maintain a car list, because list have orders. There are multiple ways to process a list in order in netlogo.

Hello, and thank you for the response. The vehicle list is basically the same as the edge list- the cars do have the list of edges to travel on. I’m not sure what you mean by the car is tags the road as ‘unattractive’. Can you point me in the right direction as to how to process the list in order in the same day? I’ve tried making it hours, instead of days, but still have the same problem. I really don’t want a tick to be in minutes if I can help it. How can i process the list of movements in order in the same tick? Thanks.

I have to ask you before:

do you have cars goingt through the same nodes twice in a day? if yes, then its not possible to put the links in order automatically.

if no, you dont really have to put it in order.

your car need to have a working-list called today-list, and it updates everyday.

everytime the car moves, it goes like(I havent code in netlogo for a while might be gramatical mistakes):

if you really want to put it in order, I think the nw extension is viable, but its not really necessary.

To put it in simple, if your path graph does not lnclude intersections (meaning the car going through a node twice or more times in a day), you can simply travel along the path just by following it, one step at a time.

If it includes intersections, than you have to tell the car how to move, because it doesnt know how to turn when it encounters crossroads.

This might be a little bit abstract only in words. If you need more help feel free to tell me.

Thank you lulunum4!

Let me give you a little more background. I am doing an epidemiological model and the cars are my transmission from one location to another. I don’t have a ‘road map’ bc it’s anonymous data and the lat/long coordinates are anonymized to me. so the edges are the trips each car makes from one location to another. And yes, they go back and forth to the same nodes in the same day as you can see in the data that I posted. so basically, a car lands on a property, there is a probability of infection of that car, then the car travels to another property and so on and so forth. The car can travel from node 1 to 2 to 3, then back to 1 to 2, then back to 1, etc. And each time, they hit a node, I calculate the probability that they become infected. So i have to follow the order of the list - that’s the empirical data I have. It’s not a simulation - yet - that will come when I randomly choose properties to infect.

I have found something, which I think is what you said here, that each car has a list of edges and i move them according to the next element in that list. But then I get hung up on the days. Not every element occurs on the same day. for example- car 1 can move to 3 different properties on day 1, then not move until day 5, then move to 5 different properties, etc.
My thoughts- make one list for each car for each day that it has a movement? Vs one list for each car and it has all the movements for all 850 days?
I also read about sub-ticks? but i’m not sure if i understand this or not.

with this current update, any further thoughts? Thank you again!

Definetely not one huge list. You should check the table extension of netlogo, it may be helpful.

also, maybe there can be some method to figure this “back-and-forth” situation, which is you have the car to do automatic routing, the nw extention makes it very simple. If you wish, feel free to contact me through email because then we can share more information and files.