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 (IOS and Android native).

prediction_rn

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.

Predictions.isOK

Return true if a prediction is in the Cache.

Predictions.isOutdated

Return true if the prediction is outdated (made previously, but now concerns a time in the past)

Predictions.getProbability

Get the level of certainty of the predictive algorithm.

Predictions.getDestinationLongitude getDestinationLatitude

Get the coordinates of the next predicted destination

Predictions.getTrip toGeojson

Get the next predicted trip in GeoJSON format.

Predictions.toLocations

Get the next trip in the form of a Location array.

Predictions.getStartTrip

Get the next start point of the prediction.

Predictions.getStartTime

Get the estimated start time predicted for the next trip.

Predictions.getStartName

Get the name (street name) of the predicted departure place.

Predictions.getArrivalTime

Get the estimated arrival time predicted for the next trip.

Predictions.getArrivalTimeUTC

Get the estimated arrival time predicted for the next trip (returns EPOCH). Only for Android Platform

Predictions.getArrivalName

Get the name (street name) of the predicted arrival place.

veery Prediction Update

veeryPredictionUpdate

Callback triggered every time a new prediction is computed by the Veery backend.