The International Simutrans Forum

 

Author Topic: Wrong Passengers get on the train  (Read 18748 times)

0 Members and 1 Guest are viewing this topic.

Offline dennosius

  • *
  • Posts: 63
  • Languages: EN,DE
Re: Wrong Passengers get on the train
« Reply #70 on: January 23, 2013, 12:50:05 PM »
Since the lenght of a convoi is important and can cause different loading of different cars, the answer is a clear in principle yes but ...

Why is it relevant in which car of a convoy something is loaded? Convoys never change (without loosing what is loaded). As I understand current loading, it is more or less random in which car something goes (something for early stops goes to front cars if those are free, but does this have any use?). Is load changed in loading (unloaded from one and loaded to another car), i.e. in order to combine load packets for the same destination?

It's mainly about rounding errors.

I would not care about rounding errors that much.

Well, first of all we should not leave capacity empty, or, even worse, overload. So we have care about the rounding errors somehow, don't we?

I wonder how rounding affects loading. Of course, if we have large capacities and not so many destinations, it doesn't matter much whether we load one item more or less. But if we have a small bus or an early railway car with a capacity of ~20 that serve 5 destinations (for goods, even modern cars have a capacity around 25, they just usually don't serve that many destinations), rounding makes some difference. The probability of being rounded up or down doesn't change (or does it?), so if a convoy has 5 cars, numbers for a destination can be rounded down 5 times and for another destination rounded up 5 times. On the other hand, if this happens, there'll be more waiting for the first and less for the latter destination, preferring the first in the next proportional loading.

I still think that loading by convoy could have some advantage. In my understanding, it would also create less packets, thus saving some memory.

I like the idea of taking care of the remainder during loading. Effect should not be systematically different from that Herman did (it's more random). Does the proposed code take care of the cases that a) we cannot add a positive remainder as everything is loaded for that destination anyway and b) we cannot add a negative remainder because nothing is loaded for that destination already?

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Wrong Passengers get on the train
« Reply #71 on: January 23, 2013, 01:09:11 PM »
Why is it relevant in which car of a convoy something is loaded? Convoys never change (without loosing what is loaded). As I understand current loading, it is more or less random in which car something goes (something for early stops goes to front cars if those are free, but does this have any use?). Is load changed in loading (unloaded from one and loaded to another car), i.e. in order to combine load packets for the same destination?

Convoys never change, but can have vehicles that transport different good types. In order to get that right you need to group the vehicles of a convoi by good type and then change this in a chain of functions leading to hole_ab. That is simply a lot of work, where a lot can go wrong in a (time-) critical routine. A lot of effort for small gain (the current change in hole_ab is very simple). I think that explains the "but" in Prissi's answer...

Offline dennosius

  • *
  • Posts: 63
  • Languages: EN,DE
Re: Wrong Passengers get on the train
« Reply #72 on: January 23, 2013, 01:22:20 PM »
Of course, when I say convoy I mean cars of the same type in a convoy. I think also current loading could profit from this, as currently loading by car requires going through the schedule again and again. Also, we could have (more likely) load for the same destination in the same car, and hole_ab had to be called much less often (of course, combining the loading capacity requires actual loading into the cars afterwards, but this also has to be done only once per convoy). When performance becomes an issue, it'll be on large maps with complex networks, and there we usually use more and longer convoys (and for 1-vehicle-convoys like most buses and ships, nothing changes).