User's next predicted trip
This section describes how to get the next predicted trip of a user as estimated by the Veery geoprofiling algorithms (Android native).
Predictions are only computed if veery was activated using Veery.PREDICTION parameter.
The Predictions are computed regularly and sent to the Veery Cache. It is therefore necessary to verify if the prediction you get is not outdated (this could also happen if the network was unavailable when the prediction was made)
It is possible to simply request for the last known prediction using the getNextTrip function but it is also possible to get warned when a new prediction have been recalculated using the function requestPredictionUpdate.
Predictions are delivered with a "Probability" which represent the percentage certainty of the predictive algorithms.
Veery Functions
getNextTrip
Get next estimated trip for that user.
requestPredictionUpdate
Request for a callback event when a new prediction is computed by the Veery Backend.
stopPredictionUpdate
Cancel the call to requestPredictionUpdate.
Veery sub-classes
Veery.Predictions
Subclass of Veery reprsenting users trips predictions.
isOK
Return true if a prediction is in the Cache.
isOutdated
Return true if the prediction is outdated (made previously, but now concerns a time in the past)
getProbability
Get the level of certainty of the predictive algorithm.
getDestinationLongitude getDestinationLatitude
Get the coordinates of the next predicted destination
getTrip toGeojson
Get the next predicted trip in GeoJSON format.
toLocations
Get the next trip in the form of a Location array.
getStartTrip
Get the next start point of the prediction.
getStartTime
Get the estimated start time predicted for the next trip.
getStartName
Get the name (street name) of the predicted departure place.
getArrivalTime
Get the estimated arrival time predicted for the next trip.
getArrivalTimeUTC
Get the estimated arrival time predicted for the next trip (returns EPOCH).
getArrivalName
Get the name (street name) of the predicted arrival place.
Veery Interfaces
PredictionUpdate
Interface could be passed as parameter to the requestnexttripUpdate function
onPredictionUpdate
Callback triggered every time a new prediction is computed by the Veery backend.