News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

[TUTORIAL] Guide to Convoy Spacing & Line Scheduling

Started by Carl, February 10, 2012, 01:50:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carl

[Comments/criticism/suggested improvements welcomed. I may add descriptions of more complex operations at a later date.]

One of the biggest problems of network-building is maintaining a regular service on a route. Buses and trains (etc) often 'bunch up' and leave irritating gaps in service. While combining the "minimum load" and "max wait for load" features fixes this to some degree, it can be complex and requires a lot of micro-management.

Extended's "convoy spacing" feature makes the process easier. In simple terms, the feature allows you to select how many times a line will depart from a certain stop per month -- and forces lines to follow a regular schedule.

Here's a step-by-step guide given in terms of trains which will work for any kind of vehicle.

First, make a route in the normal way.



Second, pick which stops you want to enforce spacing at. Note that whichever stops you pick, it's likely that most trains will wait for a while at these stops, so it's best to pick the "end of the line" stops to avoid congestion with other lines.

When you've picked the relevant stops, change "minimum load" to 100% on them. You can see below that I've picked London Victoria and London Bridge, the two termini for this service.



Third, enter a "convoy spacing" value. This value determines how many times per month a train will be allowed to leave the stops you've just designated -- it is the "convoys per month" value.

I've entered "20". The time shown under this box indicates how often a train will run on this line: as you can see, trains will run half-hourly. The time will vary depending on how long your month is (i.e. depending on what bits-per-month and distance-per-tile settings you're running).



The effect is that trains are given twenty possible "slots" to leave London Victoria, at the following multiples of 30:06:

00:30:06
01:00:12
01:30:18
02:00:24
...etc.

This means that if a train arrives at London Victoria between 00:00:00 and 00:30:06, it will have to wait until 00:30:06 before being allowed to depart. If yet another train arrives before 00:30:06, it would have to wait for the next slot at 01:00:12. If no train arrives between 00:00:00 and 00:30:06, then the 00:30:06 departure slot will simply be missed -- even if a train arrived at 00:31:00, it would then have to wait until 01:00:12 to depart. Because of this, you need to make sure to have enough trains assigned to the line, so that no slots are missed!


SPACING SHIFT
There's more that you can do with this feature, too. Imagine that the journey from Victoria to London Bridge took 31 minutes. If this was so, then a train leaving Victoria at 00:30:06 wouldn't arrive at London Bridge until 01:01:06 -- and so would have to wait a full 29 minutes before leaving again. This seems like a waste of resources. Thankfully, using the "shift" setting, we can resolve this. First, deselect "Use same shift for all stops". Now click on London Bridge in the schedule, and enter a value into the box which currently says "0".



The time displayed underneath now represents the timetable "offset" for London Bridge. This means that the departure slots from London Bridge will be as follows:

00:42:06
01:12:12
01:42:18
02:12:24
...etc.

Note that it's crucial to deselect the "Use same shift" button, because otherwise we'll be changing the Victoria departure time too -- and we don't want to do that! Note also that you'll need to play around with the spacing numbers and the "spacing_shift_divisor" in the settings menu to get the right values here. The rule here is as follows: set the "spacing_shift_divisor" to exactly the number of minutes-per-month in your game. That way, entering "1" into the shift box will amount to exactly one minute, and so on.


AN APPLICATION: FAST AND SLOW TRAINS
There are all sorts of other ways in which spacing shift can be useful. Perhaps you want a fast train and a slow stopping train to use the same tracks. This is a problem, since you'll often find that the fast train gets stuck behind the stopping train. But using the "spacing shift" feature, you can make sure that the slow train always leaves the crucial station just AFTER the fast train, thus giving the fast train a free run. Set the "convoys per month" value of both lines to the same number. Now give the slow train a "spacing shift" value of, say, 3. This will have the desired effect -- the slow train will always leave just after the fast train.


ISSUES
At spacing stations, trains will only wait until their minumum load is satisfied. So if a train reaches 100% load ten minutes before it is supposed to depart, it will depart nevertheless. This is good for economic reasons, but not so good if the spacing is part of your network management. Watch out for this. (NB. I've made a patch to increase the max. "minimum load" value to 150%, to allow one to sidestep this problem: we shall have to wait and see whether it is included in Extended).

Also bear in mind that loading times and reversing times should be taken into account when you calculate departure times. I've ignored this above for simplicity.

Moderator note: References to "Simutrans-Experimental" updated to "Simutrans-Extended" to reflect the name change, 13 February 2017.

Milko

Hello Carl

Thanks for the tutorial. Deserves to be highlighted.

So .... If I understand correctly:
The train leaves the station when one of the two is reached (One of two options triggers the start):
a) the minimum load set
b) the time spacing + shift.

Giuseppe


ӔO

what happens when you use spacing/shift in conjunction with max wait?
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Carl

I think it will add a third possible trigger condition to Milko's list above, as follows

(c) the max wait time is reached.

The effect will be that a vehicle may leave before its "spacing slot" if the max wait time is met.

Off the top of my head, I can't think of a way in which using spacing and max wait for load at the same stop would be useful.

dannyman

#5
Timely!  I was just experimenting with convoy spacing (so I could learn how it works...now I see a tutorial! =)

More education and a bug:

Q: HOW LONG SHOULD I WAIT?
A: You want to wait for your average headway, with some allowance for variance.

Q: HOW TO CALCULATE HEADWAY?
A: Average trip time / number of convoys serving line

       
  • So, if your average trip time is 17:40, and you have 3 vehicles, figure 18/3 = 6 minute headway
  • Thus, adjust convoys-per-month to ~6 minutes headway
Q: HOW TO RE-CALCULATE HEADWAY WHEN I CHANGE LINE CAPACITY?
A: Multiply current headway by current number of convoys.  Divide that number by the new number of convoys.  New headway!

       
  • So, if you have 6 minute headway with 3 convoys, that's 18:00 total ...
  • Increase service to 4 vehicles, 18/4 = 4:30 headway
Q: HOW DO I KNOW I GOT IT RIGHT?
A: Watch the line at your pulse station(s) ... the vehicles should usually arrive, be held for a very brief time, and then be on their way.
- If vehicles are often missing their pulse and having to wait for most of the headway, consider increasing the headway a little.
- If vehicles regularly wait a bit longer than you like at their pulse, consider reducing the headway a little.
- Play with time.  FF is a bit too fast sometimes, but , to slow and . to speed up are helpful when watching headways.
- If multiple vehicles are bunching up at your pulse point, something is very screwed up.  Turn off spacing, let it run on FF for a month(?) to observe "natural" baseline trip time, recalculate headway . . . try moving the pulse to a different stop . . . post bug to forum?

YOU SAID THERE WAS A BUG?

I think I found one.  On this screenshot, I did a 4:55 spacing per the above calculations.  If I set my pulse at either terminus, things work wonderfully.  If I put my pulse on the middle station (Pendale Old Street) then the dispatcher starts starts doubling my wait time.  At first, I thought it might be related to mirror schedule, so I changed it to a manual loop.  Same deal.

       
  • Wait at one terminus works fine
  • Wait at two terminii works fine
  • Any wait in the middle starts getting doubled (!?)
Most of the time, you'll set the pulse at a terminus, but in some situations you might want to set the pulse at a central transfer station . . .

Screenshot:
http://www0.toldme.com/~djh/scratch/simscr05.bmp

Save:
http://www0.toldme.com/~djh/scratch/Exp-wait-bug.sve


Wait wait ... is this a bug?  Upon further experimentation, what is happening is one vehicle arrives, waits for a pulse, another vehicle arrives and gets scheduled for the next pulse.  Vehicles arrive at mid-line stations twice as often a terminal stations, thus you wait for half the headway!  *scratches chin*  There is much to this new feature, indeed! :)

jamespetts

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.

omikron

@dannyman:

I think your bug is not a bug - as far as I can see from your screenshot, you checked the 'use same shift for all stops' button. Try without it...

omikron

EDIT: Sorry, no. The spacing works fine: just both buses wait for the next 4:55 slot, therefore one of them waits for 1:53 and the other for the next one at 6:48. If you use the spacing shift at an intermediate stop, you need to halve the shift :-)

omikron

dannyman

So, yeah ... I'll experiment a bit more with this stuff and maybe write up a tutorial as well ... this is a really neat intersection on some real-world transit management techniques I have read about ...

- If you want to pulse only at one point: easy peasy.  If you're mirroring schedule, that point ought to be a terminus.

- If you want to pulse at two points, the easiest way is to pulse at each terminus, and schedule an even number of convoys on your route.

- If you want to pulse mid-line, the easiest application might be to NOT mirror schedule.  I want to test if you can run through a station twice, but only pulse on one visit.  (I assume this works correctly..)

- If you want to pulse mid-line in both directions, you need to find a spot that will work as a fairly clean fraction of the headway, which reduces your flexibility.  This might work better at high frequency, because if a vehicle misses pulse ...

... what would be neat is a strategy to mitigate for a missed pulse cascade, where you might have vehicles waiting on top of each other in a long queue to pulse through the headway value ... ?  ideas  ?

Or maybe you really just have to set your headway value conservatively, or maybe just lower your load limit (20%..50%) to increase the chance of a vehicle skipping forward to mitigate convoys stacking up on a missed pulse.

As you can see, there is a lot of art to this new concept, and bears a lot of explanation, diagrams, illustrations, etc. :)  This is as complicated and nearly as dangerous as block signalling!! :) :)

ӔO

Quote from: dannyman on February 13, 2012, 05:55:14 AM... what would be neat is a strategy to mitigate for a missed pulse cascade, where you might have vehicles waiting on top of each other in a long queue to pulse through the headway value ... ?  ideas  ?

If this happens, what that usually means to me, is that the line does not send out frequently enough in the first place, and you have one convoy arriving before the previous one has left. Usually happens as a consequence of replacing the vehicles with better ones.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

inkelyad

Quote from: dannyman on February 13, 2012, 05:55:14 AM
... what would be neat is a strategy to mitigate for a missed pulse cascade, where you might have vehicles waiting on top of each other in a long queue to pulse through the headway value ... ?  ideas  ?
You can use multi-tile stations with extra buses. See image in my post.

chicken

Nice post. I often use this style of management to schedule multiple branches without conflicts. E.g. bring together two 9 train per month lines into a single 18 train per month corridor, using the shift to slot them in smoothly.


One problem I've had is that the 100% waiting point for each line needs to be a single track station without a choose signal. If I use two tracks with a choose signal, then both trains in the same line may try to depart at the same time.


Carl

Yes, that is a bug (which I keep forgetting to report):

If a train arrives just as or just before another waiting train's is about to leave (i.e. its wait-for-spacing is just reaching zero), the arriving train will not be pushed to the next slot but instead will try to leave straight away. So two trains use a single spacing slot. As far as I can see, this only occurs when one convoy arrives as another is leaving.

sdog

it is intentional in the platform chooser, when setting a load order one does not want a train to stop at any platform but only at the specified one to prevent locks.

dannyman

sdog,


I see trains choose different platforms for their wait loads ....


Carl

sdog -- trains will wait for spacing on as many platforms as are available. You can have several waiting at a time. The bug in question occurs only when one arrives exactly when another is leaving -- in this case it gets given the "wrong slot".

AP

Is there any word on whether the  "wait for 150% load" option will make it into the main game? I'm interested in this scheduling feature, but my key stations always have so many passengers that it will break it immediately because of the forced-departure-when-full issue.

Carl

Yes -- it's in the current release candidate version and will be in the next official release, which James has said is coming soon. The maximum value will be 400 per cent in the new version of the feature.

AP

What's the purpose of any % above 101, out of interest? Are some more 'impossible' than others? I was presuming 150% to be an arbitrary unreachable figure, to keep trains to strict timings, but maybe there's more to it than that?

Carl

100% here denotes maximum normal capacity -- so if a vehicle has 60 seats and 30 overcrowded capacity it will really only be "full" when it reaches 150% by this measure. 400% was felt to be high enough that even high-density urban vehicles would never reach it.


greenling

I have problems to use the best Convoy Spacing & Line Scheduling in simutrans exp. :-[
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

jamespetts

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.

Carl

Some may be interested in this video in which I discuss convoy spacing and line scheduling on my GB map:

http://youtu.be/31JcY7b8WnQ

While the description in the video is not as clearly step-by-step as the tutorial above, you may find it useful to see it in action.

jamespetts

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.

ӔO

I've attempted to setup scheduling on the server game and found it very time consuming, but well worth it.

As a suggestion in improving it's usability, I would suggest having a table that can record the average arrival and departure times of lines to their stops.

This table would, ideally, allow the user to edit all schedules at that station at once. The line scheduling table could also be improved if the arrival/departure is recorded there as well.

It's possible to do this externally, with an excel sheet, but it would vastly help if times were recorded.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

inkelyad

Tip about usability: there is Avarage trip time in convoy info window.
So Average trip time/numer of convoys =  spacing

ӔO

Quote from: inkelyad on February 02, 2013, 08:16:38 PM
Tip about usability: there is Avarage trip time in convoy info window.
So Average trip time/numer of convoys =  spacing

Yes, but if you run 2 or more lines on a single set of lines, you need to deal with shifting and holding trains at stations to allow express trains to pass without getting stuck behind slower trains.

On the server game, I have setup 4 lines to share the same set of tracks. Two commuter lines and two limited lines running a 48min cycle


a GUI like the attached file would be plenty, IMO.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

gfurst

I'm starting to experiment with this feature, I find it very cool but a bit hard to learn and use it.
My suggestion to improve the system is to show on the schedule's window the expect trip times, average speed time without traffic.
This is to make easier choosing spacing and shift times if wanted. An overview of the departure times and arrival times would also be extremely helpful, one such as ÆO suggested.

Additionally I think it could be good to separate entirely waiting load/max time from convoy spacing, since in most situations applying the two to the same line won't make much sense.
This is mostly because I dislike the 400% load settings. Plus from 400% it should jump straight 100%, just to make life easier.

jamespetts

These are worthwhile suggestions, but most are likely to take a very large amount of coding effort (particularly anything involving predicting arrival/departure times), and there is a rather long backlog at present. Thank you for the suggestions, however.
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.

ӔO

oh, that arrival time is not predicted, but actual arrival time.
departure time is calculated from the scheduling, rather than the convoy itself.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

gfurst

Quote from: ӔO on February 05, 2014, 12:41:19 PM
oh, that arrival time is not predicted, but actual arrival time.
You mean actual arrival time, like last logged arrived time?
Or is it calculated with all variables considered?
If is the latter, I figure it to be quite CPU expensive.
What I suggest is a expected trip time considering better path, curves hills and speed bumps, no traffic and maybe a small setback on each signal to simulate traffic.
This expected time is then saved, only updated when changing the schedule, this can be be used along side departure times and shift to calculate arrival.
Additionally the actual trip times are also recorded, so you figure out how set back that is due to traffic.

If the first is true, arrival times are not actually calculated but the last actual arrived time, my suggestion would only save the time to wait for a trip to complete, but still could give more consistent results.
Mainly the whole system works, we only have to look around some windows to get all the information.

Jando

Quote from: Carl on February 10, 2012, 01:50:11 PM
...

At spacing stations, trains will only wait until their minumum load is satisfied. So if a train reaches 100% load ten minutes before it is supposed to depart, it will depart nevertheless. ...

Is this still true? It seems I see otherwise in Experimental 11.18.

Stage coach waiting despite there being a full load available at the stop. Watched it for a game-hour now, coaches wait, then depart 5-8 minutes before the assigned spacing slot, odd.

Bug or feature? :)

Carl

That will be because no passengers will load until ~10 minutes before the scheduled departure. (This is to prevent passengers boarding a service which is not leaving for a long time, and thus missing the opportunity to join something that's leaving sooner).