Live occupancy data in transit routing

62 views
Skip to first unread message

Yunus Skeete

unread,
Feb 22, 2021, 6:46:25 AM2/22/21
to OpenTripPlanner Developers

Hi OTP Devs,  

We are a group of Master’s students conducting research on COVID-transmission-avoidant route planning. We seek to include a consideration of live occupancy data into the transit routing with the aims of investigating the effects of public transport routing recommendations that avoid crowding.

As we understand from the OTP 2 code - for transit routing, Raptor returns a wide set of possible routes for the O/D combination. These are filtered down to return the optimal route based on cost considerations. 

To factor live occupancy data into transit routing, we have two main approaches we are considering:

  1. Include the additional occupancy cost by internalizing it in the edge weights in the graph model built using OSM data.
    a. If so, would an extension of the PollingGraphUpdater class be the best option to do this?
    b. This method raises the issue of scaling the extra cost to the original edge weight. Would a scaling factor referencing the original edge weight be possible?
    c. How are edges identified in the model? Is there a unique identifier for each edge?

  2. Include an extra consideration in the filtering stage.
    a. Would this require us to extend the OTP to include the occupancy as a pareto criteria, or could the generalized cost be scaled per edge?
    b. How and where is the generalized cost calculated? 

Guidance on which method seems apt and which classes we should be looking into would be greatly appreciated. For example, where in the codebase the filtering is done or where the graph is stored.  

Thanks for the help! 

-

Yunus Skeete


Yunus Skeete

unread,
Mar 10, 2021, 9:15:57 AM3/10/21
to OpenTripPlanner Developers

Dear OTP Devs, 

As previously communicated, we intend to add the extra consideration of occupancy to the generalised cost calculated in DefaultCostCalculator. To do this, we will store a measure of occupancy for each trip according to their id and time (arrival and departure). The difficulty we are facing is in mapping between tripIds and times in OTP and GTFS. To know which trip to read and write occupancy to when planning journeys, we need to map between the two. In short, our question is as follows: 

Where and how does OTP import trip ids and trip times from GTFS – in which class does this mapping between GTFS and OTP formats occur? 

Best,

Yunus Skeete

Andrew Byrd

unread,
Mar 10, 2021, 12:35:54 PM3/10/21
to Yunus Skeete, OpenTripPlanner Developers
Hi Yunus,

GTFS is loaded by the external One Bus Away (OBA) library onebusaway-gtfs into the model classes in package org.onebusaway.gtfs.model. That project shares some history with OTP and due to overlap in the communities OTP developers can influence OBA code. But OTP now has its own internal transit model that started as a copy of the OBA model but has evolved a bit to find a common denominator with data using the Transmodel vocabulary (specifically Netex).

The mappings between the two are in package org.opentripplanner.gtfs.mapping. For example the StopMapper class there makes an OTP internal stop from a OBA stop. These mappers are called in org.opentripplanner.gtfs.mapping.GTFSToOtpTransitServiceMapper, which is used in the graph builder module org.opentripplanner.graph_builder.module.GtfsModule. 

Hope this helps,
Andrew

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-dev/f7f3532f-d3d4-4451-8019-c84ec7ce1718n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages