News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Cargo routing issue

Started by Vladki, July 27, 2016, 09:31:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

Hi James,

I have found a weird cargo routing issue. have a look at the network game, and look at the Grain mill station. The grain mill is connected to two supermarkets, there are two trucks running between grain mill and both supermarkets. There is also flour for both supermarkets available at the station, but flour for supermarket "Zdroj" is routed via the other supermarket "Jednota". Then it will take long detour via orchard or arable farm which are both connected to both supermarkets and deliver piece goods. It seems that the game thinks it is faster to take the long detour instead of direct connection.

jamespetts

Thank you for letting me know: I have not had time to look at this yet, as I have been very busy. In the meantime, it would save me some time if you could calculate the timings for the various connexions to see whether, actually, there is some logic to the goods taking this route: given that the routing itself was written by Knightly and not me, and given that he really does know what he is doing with coding, the problem is likely to be elsewhere (in the computation of the timings for individual stages).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

At the moment the problem seems to have been somehow resolved. At least on the server game.

jamespetts

Curious. At least it is working now. Thank you for updating me.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

This issue has reappeared at the server game - have a look at the grain mill

DrSuperGood

As far as I am aware the experimental server game is of such an out-of-date build any issue like this has likely been fixed. From my time playing on it, route stability was a huge problem.

The cause was because the wait times do not update regularly, as such the cargo would take routes which at load time seemed the fastest rather than which actually are the fastest. The direct route from the station to the shop might appear bad because it has a huge wait time. The slower route via the other super market and some random orchid appears faster because it has no wait time (as nothing has been routed that way before). As such on load the goods will start to go the wrong way. This continues until the wait time on the other route falls, in which case after another reload the goods will start routing along the logical route again. At the servers prime in the 1800s tens of thousands of units of freight would be routed between main cross-map transport hubs due to this wait time.

Vladki

The server was updated to the latest devel version yesterday. I update it whenever I have some time to spare.

Yes it seems to be related to the huge waiting time. This can happen due to some bad congestion or deadlock, but should fix eventually. I let the truck with flour run empty in the hope to improve the stats, but the wait time seems to be stuck at some 5:39:##

jamespetts

Dr. Supergood - I think that Vladki was referring to the special testing server for the latest devel-new builds that has been set up, rather than the Bridgewater-Brunel server.

The way in which travel times are computed is difficult to change because of the very high computational intensity of this operation: the game would run too slowly and be very unresponsive if this were done constantly rather than periodically. It is difficult to see what in principle can be done about this until very much faster computers are invented - if this ever happens.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Quote
Dr. Supergood - I think that Vladki was referring to the special testing server for the latest devel-new builds that has been set up, rather than the Bridgewater-Brunel server.
Seeing how the web interface for listing experimental servers is down (as it has been for over a years), how was I meant to know... I was only aware of 1 experimental server.

Quote
Yes it seems to be related to the huge waiting time. This can happen due to some bad congestion or deadlock, but should fix eventually. I let the truck with flour run empty in the hope to improve the stats, but the wait time seems to be stuck at some 5:39:##
You need to schedule the trucks so that they depart at regular intervals, even if empty. The slower the flow of goods, the longer the departure period. Departure period should then define the wait time maximum.

Quote
The way in which travel times are computed is difficult to change because of the very high computational intensity of this operation: the game would run too slowly and be very unresponsive if this were done constantly rather than periodically. It is difficult to see what in principle can be done about this until very much faster computers are invented - if this ever happens.
However it would be very useful if save/load did not alter the routing directions as much. As I said, one can get the insane situation where every time the map is reloaded (eg someone joins) the routing results change forcing massive amounts of goods between different locations.

jamespetts

Quote from: DrSuperGood on August 13, 2016, 10:39:42 PM
Seeing how the web interface for listing experimental servers is down (as it has been for over a years), how was I meant to know... I was only aware of 1 experimental server.

I was not criticising you for not knowing: just clarifying. I do hope that the Experimental listing server is fixed at some point.

Quote
However it would be very useful if save/load did not alter the routing directions as much. As I said, one can get the insane situation where every time the map is reloaded (eg someone joins) the routing results change forcing massive amounts of goods between different locations.

Have you any suggestions as to how practically this might be achieved?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

I have again seen a wild example of cargo routing. Even though there was a direct connection between a factory and supermarket, the cargo was rerouted via nearby stop of another factory and went on about 8-times longer (in km) journey involving 3 transfers.

I have two explanations for that - either the direct connection was temporarily delayed due to traffic congestion, thus taking longer then the huge detour, or the trucks on the direct connection spent too much time waiting for 100% load and that time was included in the calculation. In fact both things have occasionally happened in the game, so I'm not sure which one was the ultimate cause of such rerouting.

I think that waiting for load % should not be included in the journey calculation, as it will break the numbers when the source is out of stock, or destination has full storage and stops ordering more goods, thus leaving the truck waiting very long.

And as a further improvement some additional logic preferring direct connections or avoiding extremely long detours would be nice.

jamespetts

The waiting time is computed based on the actual amount of time that the cargo itself has to wait, so if a vehicle is sitting empty waiting for a full load, this time will not be taken into account.

However, it would not be workable to discount time spent waiting for a full load, or else this would not work at all well for cargoes (or passengers) that need fast transport without the delay inherent in waiting for a full load (e.g. milk). Also, taking into account anything other than a single number (i.e. total journey time) for computing which route to take is not likely to be workable within reasonable limits of performance on larger maps.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.