Moscow trains (and not only): what has changed and thanks to those who helped





600 thousand people view the schedule on our day, so every small change has a large-scale effect. I want to report a little about what we added to the application electric trains at the request of the community. And to say thanks to everyone who gave us feedback, and to show what we changed.



The first important feature is offline mode. We did not introduce it for a long time, because the meaning of the schedule is precisely in constant changes. And if you have already gone beyond the cellular coverage, it is better to upgrade so as not to arrive at the canceled train.



As it turned out, not doing it is an idea so-so, because:



  1. Many people want to see the schedule as a whole, and not according to the current situation.
  2. A completely unusual way of using the application has opened: from an escalator. And on escalators, usually some kind of 3G-LTE-interconnect or just a change of base station. At rush hour, it is also “stretched” between cell subscribers. In general, in the subway it often happens that the Internet is as it were, but there is no connection in fact.






Thanks OVAV : we began to detect such situations. Now the model of action is this: if there is a quick connection, the current schedule is always loaded. If there is no connection, the offline version is displayed (this is actually from the local cache), on it is the timestamp when it was relevant. As you browse, we can manage to get an update (the packages are very lightweight) and immediately show it directly in the on-the-fly interface. Then the mark about offline mode will be removed.







Offline mode automatically adds selected routes and viewed schedules (history). Moreover, this is not a manual download and not just a cache - we go through all your routes after accessing our servers and update everything for offline mode. You can not open your favorite routes for years, but there will always be a fresh version from the moment you last had the Internet with the application open. History is cached for those days that you already looked at the schedule.



Since the packages are very light (there is XML data for a couple of kilobytes per route), then all this is very fast.



Late Prediction



Electric trains using the API of the transport system give a status with a delay of a graph step (10 minutes), and the status will be in the last 10 minutes. That is, at 14:22 you can get an actual picture of the movement of trains at 14:12. And at 14:12 it will be assembled with a frame of 10 minutes, that is, in the worst case, the lag will be 19-20 minutes, at best - 10. We played a bit with the models and historical data and learned to reduce this window to two minutes by predicting the movement of the rest trains. That is, if the train is late not because of a sudden accident, but because of a tactical change in the schedule, then we will find out about this very reliably 8–18 minutes earlier than the actual data.



Usability



Most of all we had questions about usability. Yes, a year ago, we did not immediately open the screen that you needed: an extra click on the schedule left. Thanks to airy for the raised ticket.



Now the last search opens immediately on the start screen. Moreover, we monitor half the day: if you open the application after lunch, we rearrange the departure and destination stations in places.



They found a very beautiful bug, which they themselves laid several years ago. And it turned out that the same person who brought in was looking for him. In general, once upon a time, we needed a moment when tomorrow comes on the railway. Midnight does not fit. The fact is that the planet’s day ends at midnight, and the people at another time. And when you watch electric trains for today, you expect that after the one at 23:50, it will be shown 00:20 without switching dates.



The question was where to set the border: to show until one in the morning, until two, up to three, before five in the morning?



Since we are mathematicians, we modeled flows and took into account the distribution of flights. Since there was no big data then, they were limited to constants. Magic time was brought out for Moscow - 2:52, it was at this moment that it was most convenient to change the day.



For about five years, it went deeper and deeper into the code. Then there were a couple of tickets about the disappearance of electric trains for today: these are certain search queries between 00:00 and 2:52 (we thought that today is yesterday). And yesterday all the trains left.



As a result, we divided into more understandable categories, as we should have done initially if we hadn’t been chasing optimization in those years (but we were chasing).



Complaints rained about a bright topic: they say it’s impossible to watch the schedule at night. They made it dark, it’s fashionable now. What is characteristic: until it became fashionable, no one wrote such tickets.



Sometimes tickets were poured to the effect that "you have lost electric trains." They do not disappear here, but at the CPPK and other carriers (in the schedule). The standard behavior model is when a train leaves the schedule, it simply dissolves in the air. Users who remembered him think that they are somehow looking for something wrong and are nervous. Feel the loss of control. Now we have made the ghost of the train: a line in the schedule labeled “Canceled”. People became calmer, but we are not considered evil developers stealing trains from honest citizens.



Miss the station. There are several places where electric trains at one railway station are in two different places. For example, in the backend of the Moscow Kursk schedule two things: one - Kursky, the second - Gorky direction. These are two independent stations with common coordinates. The problem turned out to be that you can build a route from one of them to the usual point directly, or you can miss the interface and select another starting point, build a route with four transfers for two hours longer, but to the same point. People complained. We connected such places at one point and auto-correct inputs in a number of cases.



The second similar feature - there are a lot of stations with similar names. We explicitly ask the user what exactly he meant when the probability of collision is high.







Many minor improvements with geolocation: now the prompt for entering the station depends on your approximate position, we show the ones closest to you.



Karpion wrote many wishes on how the application should look in conjunction with other modes of transport. We thought that we had completed it, then we were faced with computational difficulties, then again we thought that we had completed it ... In general, it turned out somewhere completely different, somewhere better, but somewhere there are dead ends. After a stable release, my colleagues will tell in more detail.



In the meantime, I can say that we conducted a study of how much it is necessary thing at all - to cross buses with electric trains. It turned out that the right one. But, since we love the data, another important thing came up in the research process. We compared the directions in Moscow, where it is more convenient by bus, and where - by train.



Look, we have identified the directions where it matters (or where you can go directly by bus where commuter trains are needed). Sort by destination popularity. So if you have relatives living in these cities, then perhaps they will be interested in this comparison.









Direction









Price, bus









Price, train









Train transfer









Moscow - Mozhaysk









257









276









no









Moscow - Obninsk









269









284









no









Moscow - Stupino









264









279









no









Moscow - Volokolamsk









273









322









no









Moscow - Egorievsk









275









276









no









Moscow - Pereslavl-Zalessky









285









-









-









Moscow - Kubinka









94









161









no









Moscow - Petushki









253









337









no









Moscow - Voskresensk









213









230









no









Moscow - Suzdal









605









-









-









Moscow - Ryazan









379









462









no









Moscow - Zaraysk









336









-









-









Nizhny Novgorod - Murom









591









-









-









Moscow - Aleksin









484









658









Yes









Moscow - Ozyory









286









368









Yes









Moscow - Gus-Khrustalny









517









701









Yes









Moscow - Yasnogorsk









385









388









no









Moscow - Zubtsov









436









-









-









Moscow - Lakinsk









275









421









no









Veliky Novgorod - Soltsy









200









-









-











In general, about 50% of the directions of electric trains (in which both stations have a connection to the city) have an alternative from the bus schedule. At the same time, the intersection with long-distance trains is small, about 7%.



They made a very cool (for us) thing: the feature “platform and path”. At the 50 most popular stations, we began to predict where the electric train would be served based on the history of its supply and train movements. At the same time, application passengers can vote for the departure platform. That is, you came, got into your train and clicked like this:







If there are enough votes, the path and platform are shown to all passengers. If we trust you (and we trust after a few correct votes), then you will have a more powerful voice. Fifteen years ago, unknown people called us to say that somewhere there was a cancellation, and we put it on a schedule (because there was only paper). Even then, we remembered that passengers are happy to help each other. I think now we will understand how to do it better, and we will continue to look in this direction.



Well, while we were sawing different features for convenience, we also made a model of the train population. It helps to predict whether you will ride in different trains while standing or sitting. While we run it in, I’ll probably tell you more about how it ended.



We continue to saw the most accurate schedule in Runet, stay in touch and are ready for you to say what else can and should be done. We do not always do the necessary things quickly, but we always always listen. Therefore, scold or praise us, please: this is useful.



All Articles