[Patch] Improved Timetable Management [V2.31tr SVN15778]

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by bokkie »

Tekky wrote:
bokkie wrote:There seems to be a bug in Tekky's v1.30 build with cargodest, YAP(P/F) doesn't seem to work right. Trains always want to choose the shortest route, even if that isn't a free path and there's a free path right next to it which is 1 tile longer. Playing with the v1.00 without cargodest the same error seems to occur, look at the screenshot provided. Or am I doing some wrong signalling here... haven't been playing with many trains for a while :).
This is strange. What do you have the patch setting pf.yapf.rail_pbs_cross_penalty set to? In order to find this out, enter "patch pf.yapf.rail_pbs_cross_penalty" in the OpenTTD console. I think the default value is 300.
It's 300. Also tried clean trunk and clean config but same problem happens. Seems like it's my bad signalling then but I'm too blind to spot the mistake.

EDIT (and offtopic): probably is putting a reversed signal in front of the station (in case a train turns) the solution :)
Last edited by bokkie on 03 Sep 2008 18:50, edited 1 time in total.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Eddi »

the estimated schedule could need some improvement when a vehicle is late.

currently (v 1.30) the late counter is just added to all times. instead it should substract the scheduled waiting time at each stop, to show when the vehicle would be on time again, when stopping times are reduced to a minimum.
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by AndiK »

It seems that my proposal for the new FCFS system is not as easy to understand as i thought. Yesterday, I've spent more than half an hour to explain it to Regiovogel.
Put into pseudo-C-code, it could work like this:

Code: Select all

// Don't try to compile this, unless you use my patented yet nonexistent AndiKompiler

class shared_orders { // This is the "big picture", all trains on the route have in common
	[...] // what we've got already & declaration stuff
	Time GlobalTTStart;
	Time CurrentHeadway;
	Time NextTrainStartTime; // Global variables to save global stuff: TT start, Headway and the next time a train should start
}

class train_timetable {
	[...] // should just look like it already is
}

void shared_orders::SetHeadway(Time NewHeadway) {
	CurrentHeadway = NewHeadway; // self explaining, I think ^^
}

void shared_orders::SetTTStart(Time NewStartTime) {
	GlobalTTStart = NextTrainStartTime = NewTrainStartTime; // ditto
}

void shared_orders::OnTrainArrival(CTrain *ArrivingTrain) { // When a new train arrives...
	ArrivingTrain->TTStartTime = NextTrainStartTime; // ... set its new starting time to the saved value...

	NextTrainStartTime += CurrentHeadway; // ... and increase the next starting time by the amount of CurrentHeadway
}
Trains have their own timetable just like now. It just gets updated to new headway and starting times only on arrival in the first station. Thus, when you change the global timetable (new starting time or headway), trains already running complete their cycle and fit into the new timetable nicely and smoothly.
This works regardless of the trains' order on the route or where the trains come from (i.e. the depot) - who arrives first, leaves first.


One more suggestion:
Could you put some kind of marker in the train list for trains with Autofill on? I've had some problems finding my autofilling train when there were about 24 others looking just the same. ;-)

Pfiatseich,

Andi

(Who will now dissassemble his Petromax lamp in hope of finding all the holes that shouldn't be there)
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by PhilSophus »

Eddi wrote:the estimated schedule could need some improvement when a vehicle is late.

currently (v 1.30) the late counter is just added to all times. instead it should substract the scheduled waiting time at each stop, to show when the vehicle would be on time again, when stopping times are reduced to a minimum.
But vehicles need time to load/unload. Maybe the planned time is just what they need. You can't know how much is available for catching up.

@AndiK: I'll have a look on your post and comment on it later. I have my head elsewhere ATM.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Eddi »

PhilSophus wrote:You can't know how much is available for catching up.
no, you can't that's why it's an estimate.

but the estimate is completely useless as it is now, as it has absolutely no correlation to how bad the delay really is. pure loading times are rather short. so if you do not schedule additional waiting times, these times have hardly any effect on the lateness no matter if you add them to the estimate or not. the important parts are the waiting times that are increased so that the train can catch up delays (usually at the end points of the schedule, or at synchronisation points on switching stations, or at sidings, where freight trains let express trains pass). these waiting times are significantly larger than the usual loading time, and the estimated times should respect those.

on a related note: the delay notice should only appear when starting from a station, not when arriving there, as the waiting time of the station is not considered at that point.
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by PhilSophus »

Eddi wrote:pure loading times are rather short. so if you do not schedule additional waiting times, these times have hardly any effect on the lateness no matter if you add them to the estimate or not. the important parts are the waiting times that are increased so that the train can catch up delays (usually at the end points of the schedule, or at synchronisation points on switching stations, or at sidings, where freight trains let express trains pass). these waiting times are significantly larger than the usual loading time, and the estimated times should respect those.
Eddi, you obviously play with other train sets than I do. With DBsetXL and long-distance passenger coaches I usually have around 8 days for loading and unloading. So, this is not rather short in my opinion. And I usually only round up the waiting time and only provide overhead (and additional platforms) at an end point (you wrote you do the same). So, it's just not sensible to assume, most waiting times have much overhead. For my timetables this approach would make the estimate much worse than as it is now.

However, this reminds me of a feature I already had in mind and now notice would very usable for this: "Stop watches" using an exponential average of the needed waiting and traveling times. These could be used for an educated guess.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Michi_cc »

bokkie wrote:It's 300. Also tried clean trunk and clean config but same problem happens. Seems like it's my bad signalling then but I'm too blind to spot the mistake.
The relevant patch setting here is pf.yapf.rail_pbs_station_penalty and not pf.yapf.rail_pbs_cross_penalty. Default is 800.

-- Michael Lutz
-- Michael Lutz
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Tekky »

PhilSophus wrote:Unfortunately, there was a savegame bump in trunk in SVN 14232, so the diff against trunk breaks savegame compatibility. The cargodest version does not as this trunk revision is not yet merged into cargodest branch.
Meanwhile, the cargodest branch has merged with trunk. I have used the new 1.40 timetable patch against the updated cargodest branch and have created a new Win32 binary, which you can download from this link:

http://rapidshare.com/files/142353862/r ... 0.zip.html
EDIT: Meanwhile, this binary is outdated, I have posted a new one later in this thread.

Please note that I have not tested this binary thoroughly. So, as always, you are using it at your own risk. ;-)
Last edited by Tekky on 07 Sep 2008 01:53, edited 2 times in total.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: [Patch] Realistic timetables [V1.40 for SVN14234]

Post by Eddi »

PhilSophus wrote:With DBsetXL and long-distance passenger coaches I usually have around 8 days for loading and unloading.
exactly this is why you use these wagons for trains that have very few intermediate stops. that would minimise the problem. also, i schedule freight trains to wait at places where they don't load at all, then 100% of the waiting time can be used for catching up
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.50 for SVN14245]

Post by PhilSophus »

And once again a new version (V1.50):
  • Interval is always preset for the headways feature (<CTRL>-click has no function anymore)
  • Don't refuse showing arrivals/departures completely when timetable is incomplete/has conditional orders but continue as far as possible.
  • Show mini order list also for non-timetabled vehicles in integrated station timetable
  • Allow to sort by expected arrival/departure time
  • Some internal rewriting
Note: Savegame bump has reached cargodest with this version.

EDIT: A little bug creeped in and was fixed in 1.51 (garbage times were shown for vehicle timetables of non-started timetables).

AndiK wrote:It seems that my proposal for the new FCFS system is not as easy to understand as i thought. Yesterday, I've spent more than half an hour to explain it to Regiovogel.
Put into pseudo-C-code, it could work like this:

Code: Select all

[/i]

Trains have their own timetable just like now. It just gets updated to new headway and starting times only on arrival in the first station. Thus, when you change the global timetable (new starting time or headway), trains already running complete their cycle and fit into the new timetable nicely and smoothly.
This works regardless of the trains' order on the route or where the trains come from (i.e. the depot) - who arrives first, leaves first.[/quote]
Logically, it does work like this. Code-wise it can't because there is no data structure for a shared order list. An order list is just a linked list of Order structs. And if vehicles share the orders their Vehicle::orders members just point to the same linked list (i.e. first Order element). So, either this code would have to be rewritten entirely or your GlobalTTStart, CurrentHeadway, NextTrainStartTime fields would have to be in any order element, which would be a bit wasteful.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.51 for SVN14245]

Post by Tekky »

Here is a a new Win32 binary with cargodest and realistic timetables version 1.51:

http://rapidshare.com/files/142691275/r ... 1.zip.html
EDIT: This binary is now out of date. A more recent binary is available later in the thread.

I tested the new binary myself a bit and it seems to work properly. I have also scanned the .zip file for viruses using http://www.virustotal.com. However, as always, I accept no responsibility if my binary causes your monitor to explode :-)
Last edited by Tekky on 07 Sep 2008 01:40, edited 1 time in total.
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: [Patch] Realistic timetables [V1.51 for SVN14245]

Post by Tvel »

Hi,

I am having problems with the timetable window, running tekky's last binary.
There seems to be some extra windows to the right and when i drag the timetable it stays and... spreads.
Anyway a picture is needed :)

Edit: I am runing Vista Ultimate x64
Attachments
Timetable window
Timetable window
Timetable.PNG (66.49 KiB) Viewed 4237 times
Jans
Engineer
Engineer
Posts: 32
Joined: 04 Sep 2008 12:25

Re: [Patch] Realistic timetables [V1.51 for SVN14245]

Post by Jans »

Maybe it help you if you turn on the patch, that provide arrival and departure time.

You can find it in tab of interface "Show arrival and departure time in timetabels"
rbn2903
Engineer
Engineer
Posts: 122
Joined: 08 Dec 2007 18:04
Location: Aachen (Aken), Germany

Re: [Patch] Realistic timetables [V1.51 for SVN14245]

Post by rbn2903 »

I got this myself (WinXP SP3) and the temporary solution is to enable the option "show arrival and departure in timetables" in the patches menu.

Edit: oh, too late ^^ ... btw: Great patch!
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: [Patch] Realistic timetables [V1.51 for SVN14245]

Post by Tvel »

Yea enabling the patch is ok. Nevertheless it is a bug :)
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: [Patch] Realistic timetables [V1.52 for SVN14250]

Post by PhilSophus »

Phew, I can tell you, enabling and disabling whole parts of a window is a permanent nightmare.

Anyway, the fix is online (see top post). The bug must have been in there for some time. So it seems you mainly play with the features I gave you enabled :mrgreen:

Besides the bug fix and a bit of internal cleanup I also changed how start times in the virtual time scale interpreted:

Before it assumed the given time is always in the future (so if you set 19:00 at 19:01 it would take the next 19:00 in almost 24 hours). Now it assumes a window from 6 hours in the past up to 18 hours in the future. So, if its 19:01, times from 13:01 to 19:00 would be interpreted as lying the past and times from 19:02 to 13:00 in the future).
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: [Patch] Realistic timetables [V1.52 for SVN14250]

Post by Tvel »

PhilSophus wrote:The bug must have been in there for some time. So it seems you mainly play with the features I gave you enabled :mrgreen:
Yea it was there before too, but i was busy and didn't post about it :roll:
Good work :)
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [Patch] Realistic timetables [V1.52 for SVN14250]

Post by Tekky »

Here is the new Win32 binary for realistic timetables 1.52 with cargodest:

http://rapidshare.com/files/142968722/r ... 2.zip.html
EDIT: This binary is now out of date. A more recent binary is available later in the thread.

As always, you are using this binary at your own risk. ;-)


I found the following glitches in realistic timetables 1.52 with cargodest:

Now that CTRL-Headway no longer has any function, the corresponding tooltip should also be changed.

Also, not all graphical glitches were removed in the last patch, as can be seen in this screenshot (I moved the window around a bit):
Attachments
graphical glitch
graphical glitch
glitch.png (45.97 KiB) Viewed 4083 times
Last edited by Tekky on 07 Sep 2008 01:54, edited 1 time in total.
rbn2903
Engineer
Engineer
Posts: 122
Joined: 08 Dec 2007 18:04
Location: Aachen (Aken), Germany

Re: [Patch] Realistic timetables [V1.52 for SVN14250]

Post by rbn2903 »

PhilSophus wrote:Before it assumed the given time is always in the future (so if you set 19:00 at 19:01 it would take the next 19:00 in almost 24 hours). Now it assumes a window from 6 hours in the past up to 18 hours in the future. So, if its 19:01, times from 13:01 to 19:00 would be interpreted as lying the past and times from 19:02 to 13:00 in the future).
PhilSophus, may I ask you a question, because I'm not quite sure, I get this right? Does this mean that, if I use the "Headway"-Feature, there won't (only sometines) be anymore trains which run 5:50 hours late in a timetable that is about 6:30? I sometimes really wonder, why my train is THAT late. (The train in my example above should be 0:40 early and not 5:50 late, or not?) Thanks for your help!
Jans
Engineer
Engineer
Posts: 32
Joined: 04 Sep 2008 12:25

Re: [Patch] Realistic timetables [V1.52 for SVN14250]

Post by Jans »

I have try to translate all strings in the file "german.txt".

I feel sorry that I don´t be able to make a better diff at the moment. I don´t know why mingw don´t make a right head in the file. So please any one could help, do it.
Untill that time please enter the path and filename manualy.

Please report mistakes and errors.

Have a nice game!
Attachments
german.diff
(20.26 KiB) Downloaded 211 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests