The International Simutrans Forum

 

Author Topic: [PATCH] Loading pattern for multiple convoys to the same destination.  (Read 5240 times)

0 Members and 1 Guest are viewing this topic.

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
My answer to Loading pattern for multiple convoys to the same destination.

Goods/passengers will use one convoy if several is available. (A lot like loading queue). It works for each player separately.

Github link

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #1 on: October 23, 2010, 12:36:10 PM »
A question about this - will passengers continue to pile into an overcrowded vehicle (thus compromising their comfort and therefore the player's profitability) if non-overcrowded vehicles are available? Also, what happens if, during loading of one convoy, another convoy arrives which will reach the destination faster? Perhaps this is of little relevance to passengers in any event, as it is seldom sensible to set them to wait for a certain loading level; but perhaps overcrowding at least should be excluded from the loading queue?

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #2 on: October 23, 2010, 02:20:03 PM »
A question about this - will passengers continue to pile into an overcrowded vehicle (thus compromising their comfort and therefore the player's profitability) if non-overcrowded vehicles are available?
Yes, they will. ( convoi_t::hat_gehalten try load convoy up to its max capacity)
Quote
Also, what happens if, during loading of one convoy, another convoy arrives which will reach the destination faster?
There was code to test this (see commented code in line 2362 of simhalt.cc, commit d5346d7c7a709c) but it was bad for some reason ( unwanted oscillations).
Quote
Perhaps this is of little relevance to passengers in any event, as it is seldom sensible to set them to wait for a certain loading level; but perhaps overcrowding at least should be excluded from the loading queue?
It is not queue, technically. It works like this: remember in connexion where we loading. And if said convoy is still here, skip loading in current convoy.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #3 on: October 23, 2010, 02:25:42 PM »
Hmm. Do you think that you could modify this so as not to continue loading an overcrowded convoy (or a convoy about to become overcrowded) when there is a non-overcrowded convoy available? Or alternatively, perhaps, just exclude passengers from the loading queue system entirely (as passengers are rarely that conveniently behaved)?

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #4 on: October 23, 2010, 02:39:45 PM »
I'll try. But I need test map first.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #5 on: October 23, 2010, 02:48:31 PM »
Hmm, in the current released version of Pak128.Britain-Ex, most of the vehicles do not have overcrowded capacities, although I have uploaded versions to Github that do. Will this be a problem?

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #6 on: October 23, 2010, 03:03:17 PM »
Github version is fine. But what repository? You have too many of them.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #8 on: October 26, 2010, 03:32:11 PM »
Done (github). It is a bit ugly, so please read before using. I so not sure everything is right.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9565
  • Languages: De,EN,JP
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #9 on: November 13, 2010, 09:55:26 PM »
I wanted to look at this for Standard too. But I feel unable to find the relevant changes as a diff to this subject only.

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #10 on: November 13, 2010, 10:09:28 PM »
Uh. You have to cherry-pick commit d5346d7c7a709ca06f96, e420ea50a2f8afcfc66f, 5103399a6c2e895ef058.
Network feature of git hub should help too.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9565
  • Languages: De,EN,JP
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #11 on: November 13, 2010, 10:39:59 PM »
Honestly, I have no idea how to do that, since installing GIT messes up my mingw runtime, which I need to release simutrans.

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #12 on: November 13, 2010, 11:19:12 PM »
d5346d7c7a709ca06f96,
e420ea50a2f8afcfc66f,
5103399a6c2e895ef058

But my patch is useless for Standard. I use new field inside struct haltestelle_t::connexion. It is Experemental specific.

Edit:
It works like this:
Each destination remember (inside  haltestelle_t) what convoy was used last time. And then haltestelle_t::hole_ab
skip loading if that convoy hasn't left yet.
« Last Edit: November 13, 2010, 11:32:36 PM by inkelyad »

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #13 on: November 27, 2010, 09:32:56 PM »
Loading queue algorithm changed to Standard implementation.
Github link

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #14 on: November 27, 2010, 10:15:33 PM »
Thank you - implemented.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [PATCH] Loading pattern for multiple convoys to the same destination.
« Reply #15 on: December 19, 2010, 12:08:42 AM »
This has now been incorporated into 9.0.