Elvas Tower: Generate timetables automatically - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Generate timetables automatically Using AI to fill out station times Rate Topic: -----

#1 User is offline   barcelonasants 

  • Apprentice
  • Group: Status: Switchman
  • Posts: 7
  • Joined: 01-September 14
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 06 April 2021 - 05:14 PM

Dear all,

After creating a few passenger Timetables for personal use, I've been wondering whether there is (or will be) a way to automatically fill out the Timetable spreadsheet (*.timetable_or) with station times using a path or a given set of paths.

As of now, I create the paths and play them in Activity Mode to manually record the schedule for each route, which is a fun yet time-consuming process, especially in routes with lots of branching. Then, I use the Timetable editor to translate my "offline" data into something actionable, usually struggling with nuances of one-track sections.

As far as I understand, when loading an activity in Timetable Mode, Open Rails does already calculate the runs for all trains (based on the spreadsheet data, route parameters, and the .pat file) to place each vehicle in the correct position. Therefore, I assume it should be technically feasible to automatically fill out a schedule for different routes (i.e., paths) given the same set of parameters (*.pat, *.stations, frequency, speed restrictions...).

I am naive when it comes to programming, but happy to contribute ideas.

As a gift, here is a custom timetable I made for the great A Vapore in Toscana 2 route with 6 different lines and + 200 trains to choose from (there are four different Consists types, you may have to adjust those to your rolling stock).

Thank you,

BarcelonaSants

#2 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 6,927
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 06 April 2021 - 06:01 PM

Hello.
Great idea.
Furthermore, MSTS AE already have done such routine for player, though in quite a strange way.
Using given path, station-with stop list, entered by player "engineer performance"coefficient and platform stop times, taken from route data.
It was auto-calculated then.

Maybe, you would try it, then gain some new, or develop some of your existent ideas.

Thank for gift.

#3 User is offline   pschlik 

  • Conductor
  • Group: Status: Active Member
  • Posts: 331
  • Joined: 04-March 15
  • Gender:Male
  • Simulator:OpenRails - Unstable
  • Country:

Posted 06 April 2021 - 08:42 PM

I suppose if this were to be done Open Rails may want to borrow something from Train Sim World's book. In TSW, a timetable will be simulated from start to finish before it can be played in the game. While the main idea is to make sure the timetable actually works without any deadlocks, one of the steps of this simulation is keeping track of stop times so they can be automatically set based on the actual train performance. (Using autogenerated times is optional, of course.) But I think the best feature of the preemptive simulation of a timetable is that the simulation can keep track of the locations of each train at each time in the day. This is then stored in a file somewhere, and when the timetable is loaded, rather than completely resimulating the timetable from the start to the current time, the game just looks into this file and loads trains in where the file says they should go. This could dramatically improve loading times, which is one of the biggest weaknesses of timetable mode right now (this improved load time would at the expense of taking longer for the timetable creator to set up and somewhat larger file size).

#4 User is offline   barcelonasants 

  • Apprentice
  • Group: Status: Switchman
  • Posts: 7
  • Joined: 01-September 14
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 April 2021 - 04:54 AM

 pschlik, on 06 April 2021 - 08:42 PM, said:

I suppose if this were to be done Open Rails may want to borrow something from Train Sim World's book. In TSW, a timetable will be simulated from start to finish before it can be played in the game. While the main idea is to make sure the timetable actually works without any deadlocks, one of the steps of this simulation is keeping track of stop times so they can be automatically set based on the actual train performance. (Using autogenerated times is optional, of course.) But I think the best feature of the preemptive simulation of a timetable is that the simulation can keep track of the locations of each train at each time in the day. This is then stored in a file somewhere, and when the timetable is loaded, rather than completely resimulating the timetable from the start to the current time, the game just looks into this file and loads trains in where the file says they should go. This could dramatically improve loading times, which is one of the biggest weaknesses of timetable mode right now (this improved load time would at the expense of taking longer for the timetable creator to set up and somewhat larger file size).



That is a great idea! I'm not familiar with Train Sim World's book but will take a look. Generating a one-time file (it could be a *.timetable_or) makes more sense than calculating train runs every loading cycle, which adds unnecessary time. Yes, you may need a few minutes for OpenRails to calculate full timetables for larger routes, but as a reward, you get hundreds of AI trains relatively easily (i.e. a semi-automated activity generator, that is).

As for the file size, I guess it will depend on how many points you are calculating for each train, but I think the size will be manageable.

Avoiding deadlocks will be a great improvement over manually calculating (i.e. guessing) crossing sections in single-track sections.

My experience with loading times in OpenRails/MSTS is that they are sometimes oddly predetermined by the *.tdb. I use the $stoptime=n parameter to override those.

#5 User is offline   RR1 

  • Hostler
  • Group: Status: Active Member
  • Posts: 74
  • Joined: 03-March 13
  • Gender:Male
  • Simulator:OR
  • Country:

Posted 07 April 2021 - 05:23 AM

What about this? auto_table

#6 User is offline   barcelonasants 

  • Apprentice
  • Group: Status: Switchman
  • Posts: 7
  • Joined: 01-September 14
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 April 2021 - 06:10 AM

 RR1, on 07 April 2021 - 05:23 AM, said:

What about this? auto_table


Thank you for the suggestion. I know auto_table and I think it's a great tool (the perfect approach to simulate real-world timetables, actually).

My question was about an automatic timetable generator that could work on any route (real or not), given certain parameters (hourly Acela service, anyone? http://www.elvastower.com/forums/public/style_emoticons/default/whistling.gif)

Now that you mention it, I think this functionality could be easily integrated in/merged with auto_table

#7 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 6,927
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 07 April 2021 - 01:43 PM

I've heared something about "update time issue", which is the reason of some possible artifacts, when TT being loaded.
If it will be shortened, the loading time increases proportionally.

#8 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,424
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 07 April 2021 - 02:18 PM

 pschlik, on 06 April 2021 - 08:42 PM, said:

I suppose if this were to be done Open Rails may want to borrow something from Train Sim World's book. In TSW, a timetable will be simulated from start to finish before it can be played in the game. While the main idea is to make sure the timetable actually works without any deadlocks, one of the steps of this simulation is keeping track of stop times so they can be automatically set based on the actual train performance. (Using autogenerated times is optional, of course.) But I think the best feature of the preemptive simulation of a timetable is that the simulation can keep track of the locations of each train at each time in the day. This is then stored in a file somewhere, and when the timetable is loaded, rather than completely resimulating the timetable from the start to the current time, the game just looks into this file and loads trains in where the file says they should go. This could dramatically improve loading times, which is one of the biggest weaknesses of timetable mode right now (this improved load time would at the expense of taking longer for the timetable creator to set up and somewhat larger file size).

It could actually fairly easily be done (using the existing save and restore functions), but the problem is that any change in the route, consists, trains, paths, timetable or whatever would make all this data useless.
As until recently timetables were rarely if ever distributed and made available to users as complete packages there was little use for such a function.

Regards,
Rob Roeterdink

#9 User is offline   pschlik 

  • Conductor
  • Group: Status: Active Member
  • Posts: 331
  • Joined: 04-March 15
  • Gender:Male
  • Simulator:OpenRails - Unstable
  • Country:

Posted 07 April 2021 - 04:16 PM

 roeter, on 07 April 2021 - 02:18 PM, said:

It could actually fairly easily be done (using the existing save and restore functions), but the problem is that any change in the route, consists, trains, paths, timetable or whatever would make all this data useless.
As until recently timetables were rarely if ever distributed and made available to users as complete packages there was little use for such a function.

Regards,
Rob Roeterdink


Of course, and the same sort of problem exists in Train Sim World, as any change to the schedule would indeed require a resimulation of the timetable. But that's just a case of detecting when there's a discrepancy between the timetable simulation and the timetable currently present and invalidating the simulation as a result. If a timetable is missing a valid simulation, the game could just forcibly re-simulate the timetable the next time the player tries to load it up. Either way, they would have to wait through a loading screen for the timetable to simulate, but with just a couple minutes more spent in the loading screen to finish the entire simulation, the next time it loads up could be 20 times faster. A worthwhile investment I'd say.

Though some changes wouldn't justify a resimulation: even TSW has shown the simulation idea is moderately robust, as TSW features minor randomization elements (usually this means different locomotives hauling a train in-game than in simulation) which generally don't cause any trouble. Randomized consists should be coming soon to Open Rails as well, and they'll be perfect for timetable variety. I don't think that would cause any major problems with a pre-simulated timetable.

Yes, "but sometimes" it could go wrong...and that's life. If the only thing stopping this is a "but sometimes" issue, well, that's no (good) reason to give up!

#10 User is offline   barcelonasants 

  • Apprentice
  • Group: Status: Switchman
  • Posts: 7
  • Joined: 01-September 14
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 April 2021 - 05:13 PM

 roeter, on 07 April 2021 - 02:18 PM, said:

It could actually fairly easily be done (using the existing save and restore functions), but the problem is that any change in the route, consists, trains, paths, timetable or whatever would make all this data useless.
As until recently timetables were rarely if ever distributed and made available to users as complete packages there was little use for such a function.

Regards,
Rob Roeterdink


So glad to hear this should be fairly easy to implementhttp://www.elvastower.com/forums/public/style_emoticons/default/sign_rockon.gifAny idea on what would be needed?

 pschlik, on 07 April 2021 - 04:16 PM, said:

Of course, and the same sort of problem exists in Train Sim World, as any change to the schedule would indeed require a resimulation of the timetable. But that's just a case of detecting when there's a discrepancy between the timetable simulation and the timetable currently present and invalidating the simulation as a result. If a timetable is missing a valid simulation, the game could just forcibly re-simulate the timetable the next time the player tries to load it up. Either way, they would have to wait through a loading screen for the timetable to simulate, but with just a couple minutes more spent in the loading screen to finish the entire simulation, the next time it loads up could be 20 times faster. A worthwhile investment I'd say.

Though some changes wouldn't justify a resimulation: even TSW has shown the simulation idea is moderately robust, as TSW features minor randomization elements (usually this means different locomotives hauling a train in-game than in simulation) which generally don't cause any trouble. Randomized consists should be coming soon to Open Rails as well, and they'll be perfect for timetable variety. I don't think that would cause any major problems with a pre-simulated timetable.

Yes, "but sometimes" it could go wrong...and that's life. If the only thing stopping this is a "but sometimes" issue, well, that's no (good) reason to give up!





I'm with pschlik that forcing a re-simulation of the timetable in every load is not ideal but it definitely sounds like a time worth waiting to me. As a first step, I'm wondering if this may be added as an option to the Timetable Editor (to assist in generating automated *.timetable_or files). This will avoid prolonged loading times, as data would be generated/recalculated "offline".

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users