# Find path on rail network

599
7
11-13-2012 09:24 PM
Esri Regular Contributor
We have a rail network and a set of trains (A,B,C???) that should go from one point to anther (A train from a1 to a2, B train from b1 to b2 etc).
The main problem here is that two trains cannot be on the same segment in the same time (even if the segment is long).
Our idea is to find the path for train A. Then block all the segments that train A crosses in the time it crosses them before we try to solve the path for train B.
The question is how to block the segments. Should we use barriers ??? they do not have time limit (as far as I know). Should we use Historic traffic or Live traffic?
How do we translate the information about the route of train A into one of these ways before we solve train B.
It is clear that we will need code but any hint will help.

Thanks
Mody
Tags (2)
7 Replies
by
Occasional Contributor III
Hi,

This is a good question. But arcgis does only static modeling if I am not wrong. The case you suggest would need coding. a time window option might help, but it is still static. following a procedure of 1, -1, 0 , <>, or TF FT N, In coding, you could possibly make the line N indicating no access, and therefore, the second train cannot find a path,  for the required time steps. or secondly this could mean that the train would have a 'moving' origin and destination for each step, 'along' the route till they reach the final destination from the initial origin. this will call shortest path routine in each step with the moving origin and destination.

regards,
New Contributor II
Mody random question but what rail network do you use?
Esri Regular Contributor
First, this is not really a railroad network but it show my problem in a simple way.
About the static/dynamic  network. With Historic/Live traffic (10.1) you can define what will be the speed on an edge sometime in the future.
It usually comes from historic data or from real time data. In my case I would like to simulate it with data from the last train route (before the train really go).
If train A crosses some segment between 10:00 to 10:15 in this time this segment is very slow to drive on.
With both ways (Historic/Live traffic) I can estimate the delay for each segment for some time in the future. The problem is to take the data from the first route and translate it to delays in the future.
by
Occasional Contributor III
Please let us know,  is it a monorail ? or a LRT ?
Is it passenger transport or is it freight being transported ?
Esri Contributor
One possible solution to your scenario would be time-dependent restrictions.  Unfortunately, the only way to accomplish this currently is through a custom evaluator.  There is a sample that should be hugely helpful. Here is a link to the time-aware restriction evaluator:

http://www.arcgis.com/home/item.html?id=dc2e55c6e9c64cb19a5e8e3224032c87

1. Create your custom time-aware evaluator and add it to a restriction attribute.

3. Solve the route for train A with the restriction turned off, and measures turned on, and an appropriate start time.

4. Take the traversal result (or route shape) of the output route and use it to create a feature class (or csv, or whatever) of edges  along with the time in which that edge is restricted.

5. Solve the route for train B with the restriction turned on and an appropriate start time.

If the evaluator is set up properly, the edges that train A is on at the specified time should not be traversable by train B at those times.

A couple of caveats with this approach...

First, you mentioned that your description of the problem is a simplification, so I can't tell you that the above solution is the best approach.  The solution seems like a good approach based on your description.

Second, there is the registration of a custom evaluator.  This means that if you share this network (either across Desktop instances or via Server), the evaluator needs to be registered along with the network wherever it goes.

Also, there is coding involved.  You will need to take the sample evaluator and modify it to fit your needs.  Try to understand how and why it works the way it does and adjust it as appropriate.
Esri Regular Contributor
Should it be so complex?
Let me separate the problem into two different problems.
1) I have calculated a route. How do I get the time my car will be on each segment. I think if I have the ordered segment collection and the time for each segment �?? it should not be too hard to get it.
2) I have a network and information about the time it takes to cross each segment in a different time in the week. How do I put this information into the network so the routing will take it in to account.

If I solve these two questions and combine them I solve the problem.
There is not to much more into the real problem, it is just a way to make sure two "cars" will not be on the same segment in the same time.

Thanks
Esri Contributor
Should it be so complex?

Sorry that it is a complicated solution.  The problem is that Network Analyst doesn't yet support time-dependent restrictions, or non-traffic based time-dependent travel costs, unless you use a custom evaluator.

Let me separate the problem into two different problems.
1)    I have calculated a route. How do I get the time my car will be on each segment. I think if I have the ordered segment collection and the time for each segment �?? it should not be too hard to get it.

If you are on 10.1, use the geoprocessing tool Copy Traversed Source Features to generate the ordered segment collection you are looking for.

2)    I have a network and information about the time it takes to cross each segment in a different time in the week. How do I put this information into the network so the routing will take it in to account.

Not sure I understand this completely.  Are you saying you have historical travel times? Historical travel speeds/times are supported, but they are in a specific format.  Here is the help doc on historical traffic:

http://resources.arcgis.com/en/help/main/10.1/index.html#/Historical_traffic/0047000001rs000000/

Or are you saying that the paths that other trains take are known throughout the week and that is what affects travel speeds?  If that is the case, then you are back to needing a custom evaluator.

If I solve these two questions and combine them I solve the problem.
There is not to much more into the real problem, it is just a way to make sure two "cars" will not be on the same segment in the same time.

Your use case is not a common one.  For the traditional road network, you won't have segments of the road blocked by other vehicles.  That is why you will have to jump through a few hoops to get it work like you want it.