Skip to content

PredAccuracyPrediction says in comment directionId can be null as not always provided. #14

@scrudden

Description

@scrudden

A null direction stops the handleArrivalDeparture method of PredictionAccuracyModule matching an arrivalDeparture event to a PredAccuracyPrediction in memory. The map key includes direction.

PredictionKey key = new PredictionKey(arrivalDeparture.getVehicleId(), 
                arrivalDeparture.getDirectionId(), arrivalDeparture.getStopId());
        List<PredAccuracyPrediction> predsList = predictionMap.get(key);

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.

String direction=null;

                         if(update.getTrip().hasDirectionId())
                                direction=""+update.getTrip().getDirectionId();

                            if (update.getTrip() != null) {
                                Trip trip = dbConfig.getTrip(update.getTrip().getTripId());
                                if (trip != null) {
                                    direction = trip.getDirectionId();
                                } else {
                                    logger.error("Got tripTag={} but no such trip in "
                                            + "the configuration.", update.getTrip().getTripId());
                                }
                            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions