-
Notifications
You must be signed in to change notification settings - Fork 180
faq 288096257
by Quero on 2018-06-10 23:06:48
Hi to everyone and thank you very much for accepting me in the group,
I am new to traffic simulation and currently trying to understand different models. I would like to know if there is an easy way to connect macroscopic models to the microscopic model simulated in MATsim. More precisely, I was wondering if I could specify or limit the outflows from one link to the links downstream or specify the number or percentage of cars that must go from one link to another adjacent link as a time dependent function. I have seen similar topics in Chapter 50 in the MATsim's guide, but I do not know how to do it yet. I would be extremely thankful if someone could give me some insight in this regard.
Thank you in advance for your time.
All the best.
by Kai Nagel on 2018-06-13 07:42:07
MATSim is, by its design, based on routes, not on turn counts or turning fractions. So the turn counts from a link to some others during, say, an hour, are implicitly given by the outgoing links that are in the routes of the vehicles which are incoming on that link.
There is then also the link flow capacity, which primarily works as an upper limit to the outflow capacity. This is, however, a sum over all turning directions.
You could use the lanes
extension to set upper limits on outflow for each individual turn. That should be relatively straightforward (I would hope). However, it will still be secondary to the vehicles' routes -- i.e. if one turning direction is congested while another one still has flow capacity available, the vehicles will still not switch to the turning direction that has capacity available.
If you wanted to do advanced Java programming, you could replace the route-following vehicles by vehicles that check which of the lanes have capacity left, and then use one of those. That would, however, not be easy, and presumably a research project by itself.
by Quero on 2018-06-25 18:03:24
Thank you so much for your answer.
Could you please detail a bit how to implement these upper bounds. That would be great!
by Theresa Thunig on 2018-07-31 21:37:23
Dear Quero,
upper bounds (i.e. flow capacities) for the links can (and have to) be directly set in the network (e.g. in your network xml input file).
If you want to use turn specific upper bounds (i.e. flow capacities) you have to use the lanes data structure of MATSim:
1. Specify in your config, that you want to use lanes (set the parameter 'useLanes' in the module 'qsim' to true).
2. Provide lane data (in your case probably a single lane for each turn with its specific flow capacity). You can do this by either setting a lanes input file or, alternatively, filling the 'Lanes' object via code. For both you can find examples in the signals contrib
(see directory 'examples/tutorial/example90TrafficLights/' or class 'CreateSignalInputWithLanesExample' -> method 'createLanes'; I attached the links to the HEAD version of this files above).
A description of the lanes structure in MATSim can be found in chapter 12 of the MATSim book.
Let us know if this helps.
Theresa
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq