Open scrudden opened 9 years ago
I don't fully understand this issue. It appears that when an element, such as direction ID, for a PredictionKey is null that the key should still be OK. The key won't match if a non-null value is used in one place and a null value is used elsewhere. But if the direction ID is consistent then it seems that it should work fine.
So what exactly were you experiencing? Did the system not find a corresponding prediction for an arrival/departure due to the direction ID not being consistent? Or were you getting a problem such as a null pointer exception?
Hi Mike, The former (The system did not find a corresponding prediction). The GTFS feed I have has a direction in trip.txt but the GTFS-rt feed does not. So this meant I need to look up the database to find the direction of the trip. This is as was done in the NextBusPredictionAccuracyModule.
The GTFS-rt spec says about direction id
"Caution: this field is still experimental, and subject to change. It may be formally adopted in the future."
I am looking into this further.
Cheers,
Sean.
A null direction stops the handleArrivalDeparture method of PredictionAccuracyModule matching an arrivalDeparture event to a PredAccuracyPrediction in memory. The map key includes direction.
Not sure on the solution but for me I did this in the new GTFSRealtimePredictionAccuracyModule I am working on. This is similar to what is done in NextBusPredictionAccuracyModule.