• Split Ticketing Part 2

    by  • June 10, 2012 • .Net, Journal • 0 Comments

    Its been a while but I have been tinkering away with the Split Ticketing library that I have been working on – the majority of the work has been converting it from a hacktastic proof of concept to a usuable library.

    Some of the main functionality I wanted to exported was to expose the information provided by the ATCO to C# applications. This information includes:

    • Train Stations (ATCO Codes, Location)
    • Journeys (Stations visited, Times, Operator)

    To allow for the easier use of this information I am building a visualiser, so you can see all this information a lot easier – one idea I’ve had for the future is to convert this all to use DeepZoom as that would be awesome but I don’t have time at the moment.

    When you visualise the data, you can visualise just the stations, the routes, the train operators and then also the results of when performing a search.

    By performing a search, it internally tries to find the route of least cost – this is in terms of the heuristic used, not the actually monetary cost of the journey. When plotting each segment is coloured differently so you can see which parts require a different train.

    Building the algorithm was rather entertaining as I was originally a bit naive in thinking you could use just an AStar algorithm. An obvious example of this is that trains may leave the same station every half an hour, and overall there are 1.5 million+ routes that can be taken, a big task of optimising the search algorithm is to remove all the parts which aren’t needed.

    To carry this further along, if I take a train to a station early in a day that may result in a lower heuristic for that station, but may result in a huge wait further down the line, it may overall be more efficient to take a train to the same station later in the day – which buggers up the classic AStar.

    I shall be releasing the code shortly, I am currently working on trying to integrate a pricing API so I can get the costs of each segment.

    About

    Software engineer. Tea drinker

    http://MrPfister.com

    Leave a Reply

    Your email address will not be published. Required fields are marked *